Beispiel #1
0
        public void AddTest()
        {
            // ARRANGE
            LokaalService    service    = new LokaalService(ctxDb);
            LokaalController controller = SetupLokaalController(service).Result;

            // ACT
            var res = controller.Add("A", 1, "01", "Lokaal", 20, "wifi");

            // ASSERT
            Assert.IsTrue(res is ActionResult);
            Assert.IsNotNull(ctxDb.Room.Where(r => r.Gebouw == "A" && r.Verdiep == 1 && r.Gebouw == "01"));
        }
Beispiel #2
0
        public void DeleteTest()
        {
            // ARRANGE
            LokaalService    service    = new LokaalService(ctxDb);
            LokaalController controller = SetupLokaalController(service).Result;

            service.AddLokaal("A", 1, "01", "Lokaal", 20, "wifi");
            var roomId = ctxDb.Room.Where(r => r.Gebouw == "A" && r.Verdiep == 1 && r.Nummer == "01").FirstOrDefault().Id;

            // ACT
            var res = controller.Delete(roomId);

            // ASSERT
            Assert.IsTrue(res is ActionResult);
            Assert.IsNull(ctxDb.Room.Where(r => r.Gebouw == "A" && r.Verdiep == 1 && r.Nummer == "01").FirstOrDefault());
        }