public void GetLocationByIdCommandTest()
        {
            GetLocationByIdCommand commandId = CommandFactory.GetLocationByIdCommand(77);

            commandId.Execute();
            location = commandId.GetResult();
            Assert.NotNull(location);
        }
Exemplo n.º 2
0
        public HotelBuilder LocatedAt(int locationid)
        {
            try
            {
                GetLocationByIdCommand commandId = CommandFactory.GetLocationByIdCommand(locationid);
                commandId.Execute();
                _hotel.Location = commandId.GetResult();
            }catch (LocationNotFoundException)
            {
                _hotel.Location = null;
            }

            return(this);
        }
        public void DtoShouldSerializableTest()
        {
            GetLocationByIdCommand command = CommandFactory.GetLocationByIdCommand(_hotel.Location.Id);
            Location location = command.GetResult();
            HotelDTO HotelDTO = new HotelDTO(_hotel.Name, _hotel.AmountOfRooms,
                                             _hotel.RoomCapacity, _hotel.IsActive, _hotel.AddressSpecification,
                                             _hotel.PricePerRoom, _hotel.Website, _hotel.Phone, _hotel.Picture,
                                             _hotel.Stars, location);

            HotelDTO.AvailableRooms = 1000;
            var respuesta = HotelDTO.ShouldSerializeAvailableRooms();

            Assert.AreEqual(respuesta, true);
        }
Exemplo n.º 4
0
        public HotelDTO(int id, string name, int amountOfRooms, int roomCapacity,
                        bool isActive, string addressSpecs, decimal pricePerRoom, string website, string phone,
                        string picture, int stars, int locationId)
        {
            this.Id                   = id;
            this.Name                 = name;
            this.AmountOfRooms        = amountOfRooms;
            this.RoomCapacity         = roomCapacity;
            this.IsActive             = isActive;
            this.AddressSpecification = addressSpecs;
            this.PricePerRoom         = pricePerRoom;
            this.Website              = website;
            this.Phone                = phone;
            this.Picture              = picture;
            this.Stars                = stars;

            GetLocationByIdCommand commandId = CommandFactory.GetLocationByIdCommand(locationId);

            commandId.Execute();
            this.Location = commandId.GetResult();
        }