public async void CreateBooking_TwoSpots_Pass() { bool expected = true; bool actual = (await GenerateBookingData.CreateBookingWithTwoSpotsInSameMarina()).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); } }