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);
            }
        }
        public async void CreateBooking_ThreeSpots_Pass()
        {
            bool expected = true;

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

            Assert.Equal(expected, actual);
        }
        public async void CreateBooking_TwoSpots_Pass()
        {
            bool expected = true;

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

            Assert.Equal(expected, actual);
        }
        public async void CreateBooking_OneSpot_Pass()
        {
            bool expected = true;

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

            Assert.Equal(expected, actual);
        }
        public async void GetBookingsByMarinOwner_Expected2_Pass()
        {
            using (var context = Fixture.CreateContext())
            {
                bool expected = true;

                IBookingService bookingService = new BookingService(context, null, null, null, null);
                Marina          marina         = context.Marinas.Find(1);
                MarinaOwner     marinaOwner    = context.MarinaOwners.Where(mo => mo.MarinaOwnerId == marina.MarinaOwnerId).FirstOrDefault();
                bool            spotsCreated   = await GenerateBookingData.CreateBookingWithTwoSpotsInSameMarina() != null;

                var marinaOwnerBookings = (List <BookingLine>) await bookingService.GetBookingLines(marinaOwner.MarinaOwnerId);

                bool actual = marinaOwnerBookings == null ? false : marinaOwnerBookings.Count > 0 ? true : false;

                Assert.True(spotsCreated);
                Assert.Equal(expected, actual);
            }
        }
        public async void GetUnconfirmedBookingLines_Pass()
        {
            using (var context = Fixture.CreateContext())
            {
                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);
                IMarinaOwnerService marinaOwnerService = new MarinaOwnerService(context, service);
                Marina              marina             = context.Marinas.Find(1);
                MarinaOwner         marinaOwner        = context.MarinaOwners.Where(mo => mo.MarinaOwnerId == marina.MarinaOwnerId).FirstOrDefault();
                bool                spotsCreated       = await GenerateBookingData.CreateBookingWithTwoSpotsInSameMarina() != null;

                var spotsToConfirm = (List <BookingLine>) await marinaOwnerService.GetUnconfirmedBookingLines(marinaOwner.MarinaOwnerId);

                bool actual = spotsToConfirm == null ? false : spotsToConfirm.Count > 0 ? true : false;

                Assert.True(spotsCreated);
                Assert.Equal(expected, actual);
            }
        }
 public async void CreateBooking_NoParameters_Pass()
 {
     //await Assert.ThrowsAnyAsync<Exception>(() => (GenerateBookingData.CreateBookingNoParameters()));
     Assert.True(await GenerateBookingData.CreateBookingNoParameters());
 }