Ejemplo n.º 1
0
        public void CantGetInacitveRoomWithIDNotInDatabase()
        {
            // Arrange Everything We Need For Our Unit Tests
            options = new DbContextOptionsBuilder <ApplicationDBContext>()
                      .UseInMemoryDatabase(databaseName: "TestRevatureHousingData")
                      .Options;
            testContext        = new ApplicationDBContext(options);
            dummyRoomsData     = new RoomDummyData();
            dummyRooms         = dummyRoomsData.RoomsList;
            testRoomRepository = new RoomRepository(testContext);
            testRoomController = new RoomsController(testRoomRepository);
            dummyConstantRoom  = new Room()
            {
                RoomID = 12728
            };
            //Arrange
            Populate();
            //Act
            var GetRoomWithLocationIDResult = testRoomController.GetInactiveRoomByID(19).Result.Value.ToList();

            //assert
            Assert.AreEqual(GetRoomWithLocationIDResult.Count(), 0);
            //Clearing Changes
            ClearAllChanges();
        }