diff --git a/ShopifySharp.Tests/Factories/OrderServiceFactoryTest.cs b/ShopifySharp.Tests/Factories/OrderServiceFactoryTest.cs new file mode 100644 index 00000000..589d96ba --- /dev/null +++ b/ShopifySharp.Tests/Factories/OrderServiceFactoryTest.cs @@ -0,0 +1,42 @@ +using FluentAssertions; +using JetBrains.Annotations; +using ShopifySharp.Credentials; +using ShopifySharp.Factories; +using Xunit; + +namespace ShopifySharp.Tests.Factories; + +[TestSubject(typeof(OrderServiceFactory))] +[Trait("Category", "Factories")] +public class OrderServiceFactoryTest +{ + private const string ShopDomain = "some-shop-domain"; + private const string AccessToken = "some-access-token"; + + private readonly OrderServiceFactory _factory = new(); + + [Fact] + public void Create_ReturnsTheService() + { + // Act + var service = _factory.Create(ShopDomain, AccessToken); + + // Assert + service.Should().NotBeNull(); + service.Should().BeOfType().And.BeAssignableTo(); + } + + [Fact] + public void Create_WhenGivenShopifyPartnerApiCredentials_ReturnsTheService() + { + // Setup + var credentials = new ShopifyApiCredentials(ShopDomain, AccessToken); + + // Act + var service = _factory.Create(credentials); + + // Assert + service.Should().NotBeNull(); + service.Should().BeOfType().And.BeAssignableTo(); + } +} diff --git a/ShopifySharp.Tests/Factories/PartnerServiceFactoryTest.cs b/ShopifySharp.Tests/Factories/PartnerServiceFactoryTest.cs new file mode 100644 index 00000000..4af31cd0 --- /dev/null +++ b/ShopifySharp.Tests/Factories/PartnerServiceFactoryTest.cs @@ -0,0 +1,43 @@ +#nullable enable +using FluentAssertions; +using JetBrains.Annotations; +using ShopifySharp.Credentials; +using ShopifySharp.Factories; +using Xunit; + +namespace ShopifySharp.Tests.Factories; + +[TestSubject(typeof(PartnerServiceFactory))] +[Trait("Category", "Factories")] +public class PartnerServiceFactoryTest +{ + private const long OrganizationId = 123L; + private const string AccessToken = "some-access-token"; + + private readonly PartnerServiceFactory _factory = new(); + + [Fact] + public void Create_ReturnsTheService() + { + // Act + var service = _factory.Create(OrganizationId, AccessToken); + + // Assert + service.Should().NotBeNull(); + service.Should().BeOfType().And.BeAssignableTo(); + } + + [Fact] + public void Create_WhenGivenShopifyPartnerApiCredentials_ReturnsTheService() + { + // Setup + var credentials = new ShopifyPartnerApiCredentials(OrganizationId, AccessToken); + + // Act + var service = _factory.Create(credentials); + + // Assert + service.Should().NotBeNull(); + service.Should().BeOfType().And.BeAssignableTo(); + } +}