Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
nozzlegear committed Dec 19, 2023
1 parent a2ebc5c commit b82cfe4
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using ShopifySharp.Utilities;

namespace ShopifySharp.Extensions.DependencyInjection.Tests;

public class FactoryServiceTests
Expand Down Expand Up @@ -46,24 +44,23 @@ await act.Should()
}

[Fact]
public async Task FactoryServices_WhenDomainUtilityIsInjected_ShouldCreateServiceWithTheUtility()
public void FactoryServices_WhenDomainUtilityIsInjected_ShouldCreateServiceWithTheUtility()
{
// Setup
var container = new ServiceCollection();
container.AddShopifySharpServiceFactories();
container.AddShopifySharpUtilities(options =>
{
options.DomainUtility = new ShopifyDomainUtility();
options.DomainUtility = new TestDomainUtility();
});
var serviceProvider = container.BuildServiceProvider();

// Act
var orderServiceFactory = serviceProvider.GetRequiredService<IOrderServiceFactory>();
var orderService = orderServiceFactory.Create(_credentials);
var act = () => orderService.ListAsync();
// The constructor will use the domain utility to turn the domain string into a uri
var act = () => orderServiceFactory.Create(_credentials);

// Assert
await act.Should()
.ThrowAsync<TestException>();
act.Should().Throw<TestException>();
}
}

0 comments on commit b82cfe4

Please sign in to comment.