public void ModifyRoom(RoomDto room)
        {
            CheckAccessRights(room.BusinessId);

            roomManager.Modify(Mapper.Map<RoomDto, Room>(room));
        }
            public void ModifyRoomIsSuccessful()
            {
                // Arrange
                IRoomManager roomManager = MockRepository.GenerateMock<IRoomManager>();
                PropertyManagementSystemService.RoomManager = roomManager;

                RoomDto room = new RoomDto
                {
                    BusinessId = 1,
                    Id = 1,
                    Name = "hello",
                    RoomTypeId = 1
                };

                roomManager.Expect(rm => rm.Modify(Arg<Room>.Matches(r => r.BusinessId == room.BusinessId && r.Id == room.Id && r.Name == room.Name)));

                // Act
                PropertyManagementSystemService.ModifyRoom(room);

                // Assert
                roomManager.VerifyAllExpectations();
            }
Ejemplo n.º 3
0
 /// <summary>
 /// Modify Room
 /// </summary>
 /// <param name="roomDto">RoomDto</param>
 public void ModifyRoom(RoomDto roomDto)
 {
     if (roomDto == null)
     {
         throw new ValidationException(ErrorFactory.CreateAndLogError(Errors.SRVEX30070, "AdminService.ModifyRoom"));
     }
     Room roomModel = Mapper.Map<RoomDto, Room>(roomDto);
     roomManager.Modify(roomModel);
 }