コード例 #1
0
        public async Task GivenExistingBooking_WhenCruiseIsLocked_ShouldFailToUpdate()
        {
            var repository = GetBookingRepositoryForTest();
            var cruise     = await CruiseRepositoryTest.GetCruiseForTestAsync();

            var booking = await GetNewlyCreatedBookingForTestAsync(cruise, repository);

            Assert.IsFalse(booking.IsLocked);

            var cruiseRepository = new CruiseRepository();

            Assert.IsFalse(cruise.IsLocked);
            cruise.IsLocked = true;
            await cruiseRepository.UpdateMetadataAsync(cruise);

            var updateSource = GetBookingForTest(GetCabinForTest(SjoslagetDbExtensions.CabinTypeId, GetPaxForTest(firstName: "Förnamn1", lastName: "Efternamn1")));

            updateSource.Reference = booking.Reference;
            try
            {
                await repository.UpdateAsync(cruise, updateSource);

                Assert.Fail("Update booking did not throw.");
            }
            catch (BookingException)
            {
            }
        }
コード例 #2
0
 public BookingListBLL()
 {
     BookingRepository  = new BookingRepository();
     CruiseRepository   = new CruiseRepository();
     TripRepository     = new TripRepository();
     CustomerRepository = new CustomerRepository();
 }
コード例 #3
0
 public ViewMeetingsBLL()
 {
     ActivityRepository      = new ActivityRepository();
     AgencyRepository        = new AgencyRepository();
     AgencyContactRepository = new AgencyContactRepository();
     CruiseRepository        = new CruiseRepository();
 }
コード例 #4
0
 public RoomServiceBLL()
 {
     RoomClassRepository = new RoomClassRepository();
     RoomTypeRepository  = new RoomTypeRepository();
     CruiseRepository    = new CruiseRepository();
     TripRepository      = new TripRepository();
 }
コード例 #5
0
 public void Dispose()
 {
     if (BookingRepository != null)
     {
         BookingRepository.Dispose();
         BookingRepository = null;
     }
     if (TripRepository != null)
     {
         TripRepository.Dispose();
         TripRepository = null;
     }
     if (CruiseRepository != null)
     {
         CruiseRepository.Dispose();
         CruiseRepository = null;
     }
     if (AgencyRepository != null)
     {
         AgencyRepository.Dispose();
         AgencyRepository = null;
     }
     if (BookingRoomRepository != null)
     {
         BookingRoomRepository.Dispose();
         BookingRoomRepository = null;
     }
     if (BookingHistoryRepository != null)
     {
         BookingHistoryRepository.Dispose();
         BookingHistoryRepository = null;
     }
     if (LockedRepository != null)
     {
         LockedRepository.Dispose();
         LockedRepository = null;
     }
     if (CustomerRepository != null)
     {
         CustomerRepository.Dispose();
         CustomerRepository = null;
     }
     if (UserBLL != null)
     {
         UserBLL.Dispose();
         UserBLL = null;
     }
     if (SeriesRepository != null)
     {
         SeriesRepository.Dispose();
         SeriesRepository = null;
     }
     if (BusTypeRepository != null)
     {
         BusTypeRepository.Dispose();
         BusTypeRepository = null;
     }
 }
コード例 #6
0
        public async void Insert_Ports_And_Return_OK()
        {
            List <Port> items = new List <Port>();

            using (StreamReader r = new StreamReader("ports.json")) { items = JsonConvert.DeserializeObject <List <Port> >(r.ReadToEnd()); }
            CruiseRepository cruise = new CruiseRepository();
            bool             result = await cruise.InsertPorts(items);

            Assert.True(result);
        }
コード例 #7
0
 public DashBoardManagerBLL()
 {
     StoreProcedureRepository = new StoreProcedureRepository();
     CruiseRepository         = new CruiseRepository();
     BookingRepository        = new BookingRepository();
     AgencyRepository         = new AgencyRepository();
     AgencyContactRepository  = new AgencyContactRepository();
     ActivityRepository       = new ActivityRepository();
     UserRepository           = new UserRepository();
 }
コード例 #8
0
 public AgencyViewBLL()
 {
     AgencyRepository         = new AgencyRepository();
     AgencyContractRepository = new AgencyContractRepository();
     ContractRepository       = new ContractRepository();
     QuotationRepository      = new QuotationRepository();
     AgencyContactRepository  = new AgencyContactRepository();
     CruiseRepository         = new CruiseRepository();
     ActivityRepository       = new ActivityRepository();
     AgencyNotesRepository    = new AgencyNotesRepository();
     RoleRepository           = new RoleRepository();
 }
コード例 #9
0
 public BookingViewBLL()
 {
     BookingRepository        = new BookingRepository();
     TripRepository           = new TripRepository();
     CruiseRepository         = new CruiseRepository();
     AgencyRepository         = new AgencyRepository();
     BookingRoomRepository    = new BookingRoomRepository();
     BookingHistoryRepository = new BookingHistoryRepository();
     LockedRepository         = new LockedRepository();
     CustomerRepository       = new CustomerRepository();
     UserUtil = new UserUtil();
 }
コード例 #10
0
 public DashBoardBLL()
 {
     BookingRepository       = new BookingRepository();
     CruiseRepository        = new CruiseRepository();
     RoomClassRepository     = new RoomClassRepository();
     RoomTypeRepository      = new RoomTypeRepository();
     SailsModule             = SailsModule.GetInstance();
     ActivityRepository      = new ActivityRepository();
     AgencyRepository        = new AgencyRepository();
     AgencyContactRepository = new AgencyContactRepository();
     CustomerRepository      = new CustomerRepository();
     GoldenDayRepository     = new GoldenDayRepository();
 }
コード例 #11
0
 public AddSeriesBookingsBLL()
 {
     AgencyRepository        = new AgencyRepository();
     AgencyContactRepository = new AgencyContactRepository();
     SeriesRepository        = new SeriesRepository();
     TripRepository          = new TripRepository();
     RoomClassRepository     = new RoomClassRepository();
     RoomTypeRepository      = new RoomTypeRepository();
     CruiseRepository        = new CruiseRepository();
     BookingRepository       = new BookingRepository();
     BookingRoomRepository   = new BookingRoomRepository();
     CustomerRepository      = new CustomerRepository();
 }
コード例 #12
0
 public BookingViewBLL()
 {
     BookingRepository        = new BookingRepository();
     TripRepository           = new TripRepository();
     CruiseRepository         = new CruiseRepository();
     AgencyRepository         = new AgencyRepository();
     BookingRoomRepository    = new BookingRoomRepository();
     BookingHistoryRepository = new BookingHistoryRepository();
     LockedRepository         = new LockedRepository();
     CustomerRepository       = new CustomerRepository();
     UserBLL           = new UserBLL();
     SeriesRepository  = new SeriesRepository();
     BusTypeRepository = new BusTypeRepository();
 }
コード例 #13
0
 public BookingsController(
     BookingRepository bookingRepository,
     CruiseRepository cruiseRepository,
     DeletedBookingRepository deletedBookingRepository,
     AecPaymentRepository paymentRepository,
     ProductRepository productRepository,
     ReportingService reportingService)
 {
     _bookingRepository        = bookingRepository;
     _cruiseRepository         = cruiseRepository;
     _deletedBookingRepository = deletedBookingRepository;
     _paymentRepository        = paymentRepository;
     _productRepository        = productRepository;
     _reportingService         = reportingService;
 }
コード例 #14
0
 public void Dispose()
 {
     if (BookingRepository != null)
     {
         BookingRepository.Dispose();
         BookingRepository = null;
     }
     if (CruiseRepository != null)
     {
         CruiseRepository.Dispose();
         CruiseRepository = null;
     }
     if (RoomClassRepository != null)
     {
         RoomClassRepository.Dispose();
         RoomClassRepository = null;
     }
     if (RoomTypeRepository != null)
     {
         RoomTypeRepository.Dispose();
         RoomTypeRepository = null;
     }
     if (ActivityRepository != null)
     {
         ActivityRepository.Dispose();
         ActivityRepository = null;
     }
     if (AgencyRepository != null)
     {
         AgencyRepository.Dispose();
         AgencyRepository = null;
     }
     if (AgencyContactRepository != null)
     {
         AgencyContactRepository.Dispose();
         AgencyContactRepository = null;
     }
     if (CustomerRepository != null)
     {
         CustomerRepository.Dispose();
         CustomerRepository = null;
     }
     if (GoldenDayRepository != null)
     {
         GoldenDayRepository.Dispose();
         GoldenDayRepository = null;
     }
 }
コード例 #15
0
 public void Dispose()
 {
     if (BookingRepository != null)
     {
         BookingRepository.Dispose();
         BookingRepository = null;
     }
     if (TripRepository != null)
     {
         TripRepository.Dispose();
         TripRepository = null;
     }
     if (CruiseRepository != null)
     {
         CruiseRepository.Dispose();
         CruiseRepository = null;
     }
     if (AgencyRepository != null)
     {
         AgencyRepository.Dispose();
         AgencyRepository = null;
     }
     if (BookingRoomRepository != null)
     {
         BookingRoomRepository.Dispose();
         BookingRoomRepository = null;
     }
     if (BookingHistoryRepository != null)
     {
         BookingHistoryRepository.Dispose();
         BookingHistoryRepository = null;
     }
     if (LockedRepository != null)
     {
         LockedRepository.Dispose();
         LockedRepository = null;
     }
     if (CustomerRepository != null)
     {
         CustomerRepository.Dispose();
         CustomerRepository = null;
     }
     if (UserUtil != null)
     {
         UserUtil.Dispose();
         UserUtil = null;
     }
 }
コード例 #16
0
 public void Dispose()
 {
     if (AgencyRepository != null)
     {
         AgencyRepository.Dispose();
         AgencyRepository = null;
     }
     if (AgencyContractRepository != null)
     {
         AgencyContractRepository.Dispose();
         AgencyContractRepository = null;
     }
     if (ContractRepository != null)
     {
         ContractRepository.Dispose();
         ContractRepository = null;
     }
     if (QuotationRepository != null)
     {
         QuotationRepository.Dispose();
         QuotationRepository = null;
     }
     if (AgencyContactRepository != null)
     {
         AgencyContactRepository.Dispose();
         AgencyContactRepository = null;
     }
     if (CruiseRepository != null)
     {
         CruiseRepository.Dispose();
         CruiseRepository = null;
     }
     if (ActivityRepository != null)
     {
         ActivityRepository.Dispose();
         ActivityRepository = null;
     }
     if (AgencyNotesRepository != null)
     {
         AgencyNotesRepository.Dispose();
         AgencyNotesRepository = null;
     }
     if (RoleRepository != null)
     {
         RoleRepository.Dispose();
         RoleRepository = null;
     }
 }
コード例 #17
0
 public BookingReportBLL()
 {
     BookingRepository        = new BookingRepository();
     CruiseRepository         = new CruiseRepository();
     ExpenseRepository        = new ExpenseRepository();
     AgencyRepository         = new AgencyRepository();
     UserRepository           = new UserRepository();
     ExpenseHistoryRepository = new ExpenseHistoryRepository();
     CostTypeRepository       = new CostTypeRepository();
     ExpenseServiceRepository = new ExpenseServiceRepository();
     LockingExpenseRepository = new LockingExpenseRepository();
     BookingHistoryRepository = new BookingHistoryRepository();
     BookingRoomRepository    = new BookingRoomRepository();
     CustomerRepository       = new CustomerRepository();
     AgencyNotesRepository    = new AgencyNotesRepository();
 }
コード例 #18
0
        public async Task GivenBookingSource_WhenCruiseIsLocked_ShouldFailToCreate()
        {
            var cruiseRepository = new CruiseRepository();
            var cruise           = await cruiseRepository.GetActiveAsync();

            Assert.IsFalse(cruise.IsLocked);
            cruise.IsLocked = true;
            await cruiseRepository.UpdateMetadataAsync(cruise);

            try
            {
                await GetNewlyCreatedBookingForTestAsync(cruise, GetBookingRepositoryForTest());

                Assert.Fail("Create booking did not throw");
            }
            catch (BookingException)
            {
            }
        }
コード例 #19
0
        public async void Insert_Catagories_And_Return_OK()
        {
            List <Ships> items = new List <Ships>();

            List <Cabintype> cabinType = new List <Cabintype>();

            using (StreamReader r = new StreamReader("ships.json")) { items = JsonConvert.DeserializeObject <List <Ships> >(r.ReadToEnd()); }
            CruiseRepository cruise = new CruiseRepository();

            foreach (Ships item in items)
            {
                foreach (var itemType in item.cabinTypes)
                {
                    cabinType.Add(new Cabintype {
                        nid = itemType.nid, company_id = item.company_id, ship_id = item.ship_id, title = itemType.title
                    });
                }
            }
            bool result = await cruise.InsertCabinTypes(cabinType);

            Assert.True(result);
        }
コード例 #20
0
        public async void Insert_Ships_And_Return_OK()
        {
            List <Ships> items = new List <Ships>();

            List <Ship> ships = new List <Ship>();

            using (StreamReader r = new StreamReader("ships.json")) { items = JsonConvert.DeserializeObject <List <Ships> >(r.ReadToEnd()); }
            CruiseRepository cruise = new CruiseRepository();

            foreach (Ships item in items)
            {
                foreach (var itemType in item.cabinTypes)
                {
                    ships.Add(new Ship {
                        ship_id = item.ship_id, title = item.title, company_id = item.company_id
                    });
                }
            }
            bool result = await cruise.InsertShip(ships);

            Assert.True(result);
        }
コード例 #21
0
 public void Dispose()
 {
     if (StoreProcedureRepository != null)
     {
         StoreProcedureRepository.Dispose();
         StoreProcedureRepository = null;
     }
     if (CruiseRepository != null)
     {
         CruiseRepository.Dispose();
         CruiseRepository = null;
     }
     if (BookingRepository != null)
     {
         BookingRepository.Dispose();
         BookingRepository = null;
     }
     if (AgencyRepository != null)
     {
         AgencyRepository.Dispose();
         AgencyRepository = null;
     }
     if (AgencyContactRepository != null)
     {
         AgencyContactRepository.Dispose();
         AgencyContactRepository = null;
     }
     if (ActivityRepository != null)
     {
         ActivityRepository.Dispose();
         ActivityRepository = null;
     }
     if (UserRepository != null)
     {
         UserRepository.Dispose();
         UserRepository = null;
     }
 }
コード例 #22
0
 public void Dispose()
 {
     if (ActivityRepository != null)
     {
         ActivityRepository.Dispose();
         ActivityRepository = null;
     }
     if (AgencyRepository != null)
     {
         AgencyRepository.Dispose();
         AgencyRepository = null;
     }
     if (AgencyContactRepository != null)
     {
         AgencyContactRepository.Dispose();
         AgencyContactRepository = null;
     }
     if (CruiseRepository != null)
     {
         CruiseRepository.Dispose();
         CruiseRepository = null;
     }
 }
コード例 #23
0
 public void Dispose()
 {
     if (BookingRepository != null)
     {
         BookingRepository.Dispose();
         BookingRepository = null;
     }
     if (CruiseRepository != null)
     {
         CruiseRepository.Dispose();
         CruiseRepository = null;
     }
     if (TripRepository != null)
     {
         TripRepository.Dispose();
         TripRepository = null;
     }
     if (CustomerRepository != null)
     {
         CustomerRepository.Dispose();
         CustomerRepository = null;
     }
 }
コード例 #24
0
 public CruisesController(CruiseRepository cruiseRepository)
 {
     _cruiseRepository = cruiseRepository;
 }
コード例 #25
0
 public Cruise CruiseGetById(int cruiseId)
 {
     return(CruiseRepository.CruiseGetById(cruiseId));
 }
コード例 #26
0
 public IEnumerable <Cruise> CruiseGetAll()
 {
     return(CruiseRepository.CruiseGetAll());
 }
コード例 #27
0
        public void Dispose()
        {
            if (AgencyRepository != null)
            {
                AgencyRepository.Dispose();
                AgencyRepository = null;
            }

            if (AgencyContactRepository != null)
            {
                AgencyContactRepository.Dispose();
                AgencyContactRepository = null;
            }

            if (SeriesRepository != null)
            {
                SeriesRepository.Dispose();
                SeriesRepository = null;
            }

            if (TripRepository != null)
            {
                TripRepository.Dispose();
                TripRepository = null;
            }

            if (RoomClassRepository != null)
            {
                RoomClassRepository.Dispose();
                RoomClassRepository = null;
            }

            if (RoomTypeRepository != null)
            {
                RoomTypeRepository.Dispose();
                RoomTypeRepository = null;
            }

            if (CruiseRepository != null)
            {
                CruiseRepository.Dispose();
                CruiseRepository = null;
            }

            if (BookingRepository != null)
            {
                BookingRepository.Dispose();
                BookingRepository = null;
            }

            if (BookingRoomRepository != null)
            {
                BookingRoomRepository.Dispose();
                BookingRoomRepository = null;
            }

            if (CustomerRepository != null)
            {
                CustomerRepository.Dispose();
                CustomerRepository = null;
            }
        }
コード例 #28
0
 public IList <Cruise> CruiseGetAllByTrip(SailsTrip trip)
 {
     return(CruiseRepository.CruiseGetAllByTrip(trip));
 }
コード例 #29
0
 public ReportingController(CruiseRepository cruiseRepository, ReportingService reportingService, ReportRepository reportRepository)
 {
     _cruiseRepository = cruiseRepository;
     _reportingService = reportingService;
     _reportRepository = reportRepository;
 }
コード例 #30
0
 public CruiseService(CruiseRepository repo)
 {
     _repo = repo;
 }