public void ReturnNull_WhenNotFound() { var notFoundOrderId = Guid.NewGuid(); using var context = new MobilesContext(fixture.ContextOptions); var sut = new GetMobileByOrderIdQuery(context, new DateTimeCreator()); var actual = sut.Get(notFoundOrderId); actual.Should().BeNull(); }
public void ReturnMobile() { var mobileBuilder = new MobileBuilder(); var expectedMobile = mobileBuilder .WithMobileState(Mobile.MobileState.New) .WithOrderType(Order.OrderType.Provision) .WithOrderState(Order.State.New) .Build(); fixture.DataAccess.Add(expectedMobile); using var context = new MobilesContext(fixture.ContextOptions); var sut = new GetMobileByOrderIdQuery(context, new DateTimeCreator()); var actual = sut.Get(expectedMobile.Orders.First().GlobalId); actual.Should().BeEquivalentTo(expectedMobile); }