Beispiel #1
0
        public void AddNewTest()
        {
            var roomA = _romTypeRepository.Get(s => s.RoomTypeName == "Room Type A");
            var room  = new Room
            {
                RoomCode    = "R0011",
                Description = "Room demo",
                RoomTypeId  = roomA.Id
            };

            room.Created(Guid.NewGuid());

            _roomRepository.Add(room);
            Assert.True(_context.SaveChangesAsync().Result);
        }
Beispiel #2
0
        public Room GetEager(long id)
        {
            Room room = base.Get(id);

            room.RoomType = _roomTypeRepository.Get(room.RoomType.GetId());

            foreach (KeyValuePair <Equipment, int> pair in room.Equipment_inventory)
            {
                Equipment temp = _equipmentRepository.Get(pair.Key.Id);
                pair.Key.Name   = temp.Name;
                pair.Key.Type   = temp.Type;
                pair.Key.Amount = temp.Amount;
            }
            return(room);
        }
        public void GetWithPredicateTest()
        {
            var roomType = _repository.Get(s => s.RoomTypeName == "Room Type C");

            Assert.NotNull(roomType);
        }
Beispiel #4
0
 public RoomType Get(long id)
 {
     return(_repository.Get(id));
 }