Exemple #1
0
            public void ReturnOne_WhenNoOrders()
            {
                using var context = new MobilesContext(fixture.ContextOptions);
                var sut = new GetNextMobileIdQuery(context);

                var actual = sut.Get();

                actual.Should().Be(1);
            }
Exemple #2
0
            public void ReturnNextMobileId()
            {
                var mobileBuilder = new MobileBuilder();
                var mobile        = mobileBuilder
                                    .WithMobileState(Mobile.MobileState.Live)
                                    .WithOrderType(Order.OrderType.Activate)
                                    .WithOrderState(Order.State.Completed)
                                    .Build();

                fixture.DataAccess.Add(mobile);
                using var context = new MobilesContext(fixture.ContextOptions);
                var sut = new GetNextMobileIdQuery(context);

                var actual = sut.Get();

                actual.Should().Be(mobile.Id + 1);
            }