mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 16:12:49 -05:00
[PM-5548] Eliminate in-app purchase logic (#3640)
* Eliminate in-app purchase logic * Totally remove obsolete and unused properties / types * Remove unused enum values * Restore token update
This commit is contained in:
@ -1,40 +0,0 @@
|
||||
using Bit.Core.Services;
|
||||
using Bit.Test.Common.AutoFixture;
|
||||
using Bit.Test.Common.AutoFixture.Attributes;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using NSubstitute;
|
||||
using NSubstitute.Core;
|
||||
using Xunit;
|
||||
|
||||
namespace Bit.Core.Test.Services;
|
||||
|
||||
[SutProviderCustomize]
|
||||
public class AppleIapServiceTests
|
||||
{
|
||||
[Theory, BitAutoData]
|
||||
public async Task GetReceiptStatusAsync_MoreThanFourAttempts_Throws(SutProvider<AppleIapService> sutProvider)
|
||||
{
|
||||
var result = await sutProvider.Sut.GetReceiptStatusAsync("test", false, 5, null);
|
||||
Assert.Null(result);
|
||||
|
||||
var errorLog = sutProvider.GetDependency<ILogger<AppleIapService>>()
|
||||
.ReceivedCalls()
|
||||
.SingleOrDefault(LogOneWarning);
|
||||
|
||||
Assert.True(errorLog != null, "Must contain one error log of warning level containing 'null'");
|
||||
|
||||
static bool LogOneWarning(ICall call)
|
||||
{
|
||||
if (call.GetMethodInfo().Name != "Log")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var args = call.GetArguments();
|
||||
var logLevel = (LogLevel)args[0];
|
||||
var exception = (Exception)args[3];
|
||||
|
||||
return logLevel == LogLevel.Warning && exception.Message.Contains("null");
|
||||
}
|
||||
}
|
||||
}
|
@ -26,8 +26,6 @@ public class StripePaymentServiceTests
|
||||
[BitAutoData(PaymentMethodType.BitPay)]
|
||||
[BitAutoData(PaymentMethodType.Credit)]
|
||||
[BitAutoData(PaymentMethodType.WireTransfer)]
|
||||
[BitAutoData(PaymentMethodType.AppleInApp)]
|
||||
[BitAutoData(PaymentMethodType.GoogleInApp)]
|
||||
[BitAutoData(PaymentMethodType.Check)]
|
||||
public async void PurchaseOrganizationAsync_Invalid(PaymentMethodType paymentMethodType, SutProvider<StripePaymentService> sutProvider)
|
||||
{
|
||||
|
Reference in New Issue
Block a user