Skip to content

Commit

Permalink
Attempt to fix integration tests by changing order of tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Viincenttt committed Sep 29, 2024
1 parent a632e6e commit c52547f
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions tests/Mollie.Tests.Integration/Api/SubscriptionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,24 +88,6 @@ public async Task CanCreateSubscription() {
subscriptionResponse.StartDate.Should().Be(subscriptionRequest.StartDate.Value.Date);
}

[DefaultRetryFact]
public async Task CanCancelSubscription() {
// Given
string customerId = await GetFirstCustomerWithValidMandate();
ListResponse<SubscriptionResponse> subscriptions = await _subscriptionClient.GetSubscriptionListAsync(customerId);

// When
SubscriptionResponse subscriptionToCancel = subscriptions.Items
.FirstOrDefault(s => s.Status != SubscriptionStatus.Canceled);
if (subscriptionToCancel != null) {
await _subscriptionClient.CancelSubscriptionAsync(customerId, subscriptionToCancel.Id);
SubscriptionResponse cancelledSubscription = await _subscriptionClient.GetSubscriptionAsync(customerId, subscriptionToCancel.Id);

// Then
cancelledSubscription.Status.Should().Be(SubscriptionStatus.Canceled);
}
}

[DefaultRetryFact]
public async Task CanUpdateSubscription() {
// Given
Expand All @@ -124,6 +106,24 @@ public async Task CanUpdateSubscription() {
}
}

[DefaultRetryFact]
public async Task CanCancelSubscription() {
// Given
string customerId = await GetFirstCustomerWithValidMandate();
ListResponse<SubscriptionResponse> subscriptions = await _subscriptionClient.GetSubscriptionListAsync(customerId);

// When
SubscriptionResponse subscriptionToCancel = subscriptions.Items
.FirstOrDefault(s => s.Status != SubscriptionStatus.Canceled);
if (subscriptionToCancel != null) {
await _subscriptionClient.CancelSubscriptionAsync(customerId, subscriptionToCancel.Id);
SubscriptionResponse cancelledSubscription = await _subscriptionClient.GetSubscriptionAsync(customerId, subscriptionToCancel.Id);

// Then
cancelledSubscription.Status.Should().Be(SubscriptionStatus.Canceled);
}
}

[DefaultRetryFact]
public async Task CanCreateSubscriptionWithMetaData() {
// If: We create a subscription with meta data
Expand Down

0 comments on commit c52547f

Please sign in to comment.