コード例 #1
0
        public async void ConfirmSpotBooked_ExpectedTrue_Success()
        {
            using (var context = Fixture.CreateContext())
            {
                // arrange
                bool spotsCreated = await GenerateBookingData.CreateBookingWithOneSpot() != null;

                bool                  expected           = true;
                ILocationService      locationService    = new LocationService(context);
                IMarinaService        marinaService      = new MarinaService(context, locationService);
                IBookingFormService   bookingFormService = new BookingFormService(context, marinaService);
                IBookingLineService   service            = new BookingLineService(context, bookingFormService);
                IPDFService <Booking> pDFService         = new BookingPDFService();
                IBookingService       bookingService     = new BookingService(context, service, null, pDFService, null);
                IMarinaOwnerService   marinaOwnerService = new MarinaOwnerService(context, service);

                // act
                var unconfirmedBookingLines = (List <BookingLine>) await marinaOwnerService.GetUnconfirmedBookingLines(1);

                bool actual = await bookingService.ConfirmSpotBooked(unconfirmedBookingLines.First().BookingLineId);

                // assert
                Assert.True(spotsCreated);
                Assert.Equal(expected, actual);
            }
        }
コード例 #2
0
        public async void CreateBooking_OneSpot_Pass()
        {
            bool expected = true;

            bool actual = (await GenerateBookingData.CreateBookingWithOneSpot()).BookingId > 0;

            Assert.Equal(expected, actual);
        }