diff --git a/Tests/VTEX.Integration.Tests/OrderServiceTests.cs b/Tests/VTEX.Integration.Tests/OrderServiceTests.cs new file mode 100644 index 00000000..457bc7fb --- /dev/null +++ b/Tests/VTEX.Integration.Tests/OrderServiceTests.cs @@ -0,0 +1,29 @@ +using System.Threading.Tasks; +using NSubstitute; +using Xunit; + +public class OrderServiceTests +{ + private readonly IOrderRepository _orderRepository; + private readonly OrderService _orderService; + + public OrderServiceTests() + { + _orderRepository = Substitute.For(); + _orderService = new OrderService(_orderRepository); + } + + [Fact] + public async Task ShouldReturnOrder() + { + // Arrange + var fakeOrder = OrderGenerator.CreateFakeOrder(); + _orderRepository.GetOrderAsync(Arg.Any()).Returns(Task.FromResult(fakeOrder)); + + // Act + var result = await _orderService.GetOrderAsync(fakeOrder.OrderId); + + // Assert + Assert.Equal(fakeOrder.OrderId, result.OrderId); + } +} \ No newline at end of file