Esempio n. 1
0
 public AnimalCentre()
 {
     hotel               = new Hotel();
     services            = new Dictionary <string, IProcedure>();
     this.adoptedAnimals = new Dictionary <string, List <string> >();
     InitializeServices();
 }
 public RoomReservation(
     IHotel hotel,
     IFindRoom findFreeRoom)
 {
     _hotel        = hotel;
     _findFreeRoom = findFreeRoom;
 }
Esempio n. 3
0
 public AnimalCentre()
 {
     this.hotel          = new Hotel();
     this.procedures     = new Dictionary <string, IProcedure>();
     this.adoptedAnimals = new Dictionary <string, List <string> >();
     InitializateProcedurs();
 }
Esempio n. 4
0
 public Reservation(IHotel hotel, IAccomodationProperty room, IClient client, DateTime date)
 {
     this.Hotel  = hotel;
     this.Room   = room;
     this.Client = client;
     this.Date   = date.Date;
 }
Esempio n. 5
0
 public AnimalCentre()
 {
     this.animalFactory  = new AnimalFactory();
     this.hotel          = new Hotel();
     this.procedures     = new List <IProcedure>();
     this.adoptedAnimals = new Dictionary <string, List <string> >();
 }
Esempio n. 6
0
 /// <summary>
 /// Instantiates a new HotelsController object.
 /// </summary>
 /// <param name="hotel">
 /// IHotel: a repository object that implements the IHotel interface
 /// </param>
 public HotelsController(IHotel hotel, IHotelRoom hotelRoom, IRoom room, IAmenity amenity)
 {
     _hotel     = hotel;
     _hotelRoom = hotelRoom;
     _room      = room;
     _amenity   = amenity;
 }
 public RoomReservavtionTests()
 {
     _hotel           = Substitute.For <IHotel>();
     _hotel.Rooms     = HotelRooms();
     _findFreeRoom    = Substitute.For <IFindRoom>();
     _roomReservation = new RoomReservation(_hotel, _findFreeRoom);
 }
Esempio n. 8
0
 public AnimalCentre()
 {
     this.hotel         = new Hotel();
     this.history       = new Dictionary <string, IProcedure>();
     this.ownersAnimals = new Dictionary <string, List <string> >();
     this.animalFactory = new AnimalFactory();
     this.InitializeServices();
 }
Esempio n. 9
0
 public AnimalCentre()
 {
     this.hotel         = new Hotel();
     this.animalFactory = new AnimalFactory();
     this.procedures    = new Dictionary <string, IProcedure>();
     CreateProcedures();
     this.ownerAnimals = new Dictionary <string, List <string> >();
 }
Esempio n. 10
0
        public void ReserveRoom(IHotel hotel, int numberOfPeople, string extras, DateTime date)
        {
            IAccomodationProperty roomFound = hotel.checkAvailability(numberOfPeople, extras, date);

            Validation.CheckIfObjectIsNull(roomFound);

            this.reservations.Add(new Reservation(hotel, roomFound, this, date));
        }
Esempio n. 11
0
 public QueueEntry(QueueEntryType type, IHotel hotel = null, IRoom room = null, IUser user = null,
                   IReservation reservation          = null)
 {
     Type        = type;
     Hotel       = new Hotel(hotel);
     Room        = new Room(room);
     User        = new User(user);
     Reservation = new Reservation(reservation);
 }
Esempio n. 12
0
 public Booking(IHotel hotel, RoomType roomType, IEnumerable <IPerson> persons, DateTime startDate, DateTime endDate)
 {
     id             = Guid.NewGuid().ToString();
     this.persons   = persons;
     this.hotel     = hotel;
     this.roomType  = roomType;
     this.startDate = startDate;
     this.endDate   = endDate;
 }
Esempio n. 13
0
        public AnimalCentre(Hotel hotel, Dictionary <string, List <IAnimal> > owners)
        {
            this.owners = owners;
            this.hotel  = hotel;

            this.chip       = new Chip();
            this.vaccinate  = new Vaccinate();
            this.play       = new Play();
            this.nailTrim   = new NailTrim();
            this.dentalCare = new DentalCare();
            this.fitness    = new Fitness();
        }
Esempio n. 14
0
 public AnimalCentre()
 {
     this.hotel         = new Hotel();
     this.animalFactory = new AnimalFactory();
     this.chip          = new Chip();
     this.vaccinate     = new Vaccinate();
     this.fitness       = new Fitness();
     this.nailTrim      = new NailTrim();
     this.play          = new Play();
     this.dentailCare   = new DentalCare();
     this.owners        = new Dictionary <string, List <string> >();
 }
Esempio n. 15
0
        static void Main(string[] args)

        {
            HotelCreator hotelFactory = new HotelIntercontinentalCreator();
            IHotel       hotel        = hotelFactory.FactoryMethod();

            hotel.BuildHotel();

            HotelCreator hotelcreator2 = new HotelBahiaDelSolCreator();
            IHotel       hotel2        = hotelcreator2.FactoryMethod();

            hotel2.BuildHotel();
        }
Esempio n. 16
0
        public AnimalCentre(
            IHotel hotel,
            IAnimalFactory animalFactory,
            IProcedureFactory procedureFactory)
        {
            this.hotel            = hotel;
            this.animalFactory    = animalFactory;
            this.procedureFactory = procedureFactory;

            this.animals        = new List <IAnimal>();
            this.procedures     = new List <IProcedure>();
            this.adoptedAnimals = new Dictionary <string, List <string> >();
        }
Esempio n. 17
0
 public IBooking CreateReservation(IHotel hotel, RoomType roomType, IEnumerable <IPerson> persons, DateTime startDate, DateTime endDate)
 {
     if (bookingHelper.IsRoomAvailable(hotel, roomType, startDate, endDate))
     {
         var booking = new Booking(hotel, roomType, persons, startDate, endDate);
         paymentService.RecievePayment(booking);
         bookingHelper.UpdateInventory(booking);
         return(booking);
     }
     else
     {
         return(null);
     }
 }
Esempio n. 18
0
 public Hotel(IHotel hotel)
 {
     Id = ObjectId.GenerateNewId().ToString();
     if (hotel == null)
     {
         return;
     }
     Name          = hotel.Name ?? "";
     BuiltDateTime = hotel.BuiltDateTime != null ? hotel.BuiltDateTime : new DateTime();
     Room          = new Room(hotel.Room);
     Rooms         = new List <IRoom> {
         Room
     };
 }
Esempio n. 19
0
 public AnimalCentre()
 {
     this.hotel          = new Hotel();
     this.animalFactory  = new AnimalFactory();
     this.adoptedAnimals = new Dictionary <string, List <string> >();
     this.chip           = new Chip();
     this.dentalCare     = new DentalCare();
     this.fitness        = new Fitness();
     this.nailTrim       = new NailTrim();
     this.play           = new Play();
     this.vaccinate      = new Vaccinate();
     this.procedures     = new List <IProcedure>();
     this.AddAllProcedures();
 }
Esempio n. 20
0
 public AnimalCentre()
 {
     this.animalFactory    = new AnimalFactory.AnimalFactory(); // zaradi namespace
     this.hotel            = new Hotel();
     this.adoptedAnimals   = new Dictionary <string, List <string> >();
     this.procedureAnimals = new Dictionary <string, IProcedure>
     {
         { "Chip", new Chip() },
         { "DentalCare", new DentalCare() },
         { "Fitness", new Fitness() },
         { "NailTrim", new NailTrim() },
         { "Play", new Play() },
         { "Vaccinate", new Vaccinate() }
     };
 }
 public AnimalCentre()
 {
     this.adoptedAnimals   = new Dictionary <string, List <string> >();
     this.factoryAnimal    = new FactoryAnimal();
     this.hotel            = new Hotel();
     this.procedureAnimals = new Dictionary <string, IProcedure>()
     {
         { "Chip", new Chip() },
         { "DentalCare", new DentalCare() },
         { "Fitness", new Fitness() },
         { "NailTrim", new NailTrim() },
         { "Play", new Play() },
         { "Vaccinate", new Vaccinate() },
     };
 }
        private void Initialize(int size)
        {
            if (size > 1000)
            {
                throw new ArgumentException("Hotel size can't be over 1000 rooms");
            }

            Hotel      = new Hotel();
            Hotel.Size = size;

            // generate rooms for hotel
            for (var i = 1; i <= size; i++)
            {
                Hotel.Rooms.Add(new Room(i));
            }
        }
Esempio n. 23
0
        public DBTestBase()
        {
            _connection = new SqliteConnection("Filename=:memory:");
            _connection.Open();
            _db = new AsyncInnDbContext(
                new DbContextOptionsBuilder <AsyncInnDbContext>()
                .UseSqlite(_connection)
                .Options);

            _db.Database.EnsureCreated();

            _hotel     = new HotelRepo(_db, _hotelRoom);
            _hotelRoom = new HotelRoomRepo(_db, _room);
            _room      = new RoomRepo(_db, _amenities);
            _amenities = new AmenitiesRepo(_db);
        }
Esempio n. 24
0
 public AnimalCentre(IHotel hotel,
                     IProcedure procedure,
                     Chip chip,
                     DentalCare dentalcare,
                     Fitness fitness,
                     NailTrim nailtrim,
                     Play play,
                     Vaccinate vaccinate)
 {
     this.hotel     = hotel;
     this.procedure = procedure;
     chip           = new Chip();
     dentalcare     = new DentalCare();
     fitness        = new Fitness();
     nailtrim       = new NailTrim();
     play           = new Play();
     vaccinate      = new Vaccinate();
 }
 //Hotel Rooms constructor-- brings in code into a class
 public HotelRoomsController(AsyncInnDbContext context, IHotel hotel, IRoom room)
 {
     _context = context;
     _hotel   = hotel;
     _room    = room;
 }
 public AnimalCentre()
 {
     this.hotel = new Hotel();
 }
Esempio n. 27
0
 public HotelsController(IHotel hotelRepo)
 {
     _hotelRepo = hotelRepo;
 }
Esempio n. 28
0
 public HotelsController(IHotel context)
 {
     _hotel = context;
 }
Esempio n. 29
0
 public HotelsController(IHotel hotel)
 {
     _hotel = hotel;
 }
Esempio n. 30
0
 public HotelsController(IHotel hotels)
 {
     _hotels = hotels;
 }