1
0
mirror of https://github.com/bitwarden/server.git synced 2024-11-25 12:45:18 +01:00
bitwarden-server/test/Core.Test/Billing/Utilities.cs

24 lines
723 B
C#

using Bit.Core.Billing;
using Xunit;
using static Bit.Core.Billing.Utilities;
namespace Bit.Core.Test.Billing;
public static class Utilities
{
public static async Task ThrowsContactSupportAsync(
Func<Task> function,
string internalMessage = null,
Exception innerException = null)
{
var contactSupport = ContactSupport(internalMessage, innerException);
var exception = await Assert.ThrowsAsync<BillingException>(function);
Assert.Equal(contactSupport.ClientFriendlyMessage, exception.ClientFriendlyMessage);
Assert.Equal(contactSupport.Message, exception.Message);
Assert.Equal(contactSupport.InnerException, exception.InnerException);
}
}