public void UpdateRoomTest() { var service = new Service1(); Room room = new Room { Number = "tt", Roominess = 15 }; Room roomPrev = new Room(); roomPrev = service.AddRoom(room); Room roomPlug = new Room(); roomPlug = roomPrev; roomPlug.Number = "df"; roomPlug.Roominess = 15; service.UpdateRoom(roomPlug); Room roomPost = new Room(); roomPost = service.FindByIDRoom(roomPrev.ID_Room); service.DeleteUser(roomPost.ID_Room); Assert.AreNotEqual(roomPrev, roomPost); }
public void AddRoomTest() { var service = new Service1(); var roomColPrev = service.SelectRoom().Count; Room room = new Room { Number = "tt", Roominess = 16 }; Room room2 = new Room(); room2 = service.AddRoom(room); var roomColPost = service.SelectRoom().Count; service.DeleteRoom(room2.ID_Room); Assert.AreEqual(roomColPrev + 1, roomColPost); }
public void FindByIDRoomTest() { Service1 service = new Service1(); Room room = new Room { Number = "TestRoom", Roominess = 15 }; Room roomPrev = new Room(); roomPrev = service.AddRoom(room); Room roomPost = new Room(); roomPost = service.FindByIDRoom(roomPrev.ID_Room); service.DeleteRoom(roomPrev.ID_Room); Assert.AreEqual(roomPrev.ID_Room, roomPost.ID_Room); }