Beispiel #1
0
        public void ADMView_Default_model()
        {
            // Arrange
            HomeController controller = new HomeController();

            // Act
            var result = controller.ADMView();

            // Assert
            Assert.IsInstanceOf(typeof(ViewResult), result);
            Assert.IsNotNull(((ViewResult)result).Model);
            Assert.AreEqual(((ViewResult)result).Model, 0);
            Assert.AreEqual(((ViewResult)result).ViewBag.SelectedDepartment, null);
        }
Beispiel #2
0
        public void ADMView_DefaultTabAndEmptyString_model()
        {
            // Arrange
            HomeController controller  = new HomeController();
            string         selectedDep = String.Empty;

            // Act
            var result = controller.ADMView(0, selectedDep);

            // Assert
            Assert.IsInstanceOf(typeof(ViewResult), result);
            Assert.IsNotNull(((ViewResult)result).Model);
            Assert.AreEqual(((ViewResult)result).Model, 0);
            Assert.AreEqual(((ViewResult)result).ViewBag.SelectedDepartment, selectedDep);
        }
Beispiel #3
0
        public void ADMView_2AndSDDIU_model()
        {
            // Arrange
            HomeController controller  = new HomeController();
            int            tab         = 2;
            string         selectedDep = "SDDDA";

            // Act
            var result = controller.ADMView(tab, selectedDep);

            // Assert
            Assert.IsInstanceOf(typeof(ViewResult), result);
            Assert.IsNotNull(((ViewResult)result).Model);
            Assert.AreEqual(((ViewResult)result).Model, tab);
            Assert.AreEqual(((ViewResult)result).ViewBag.SelectedDepartment, selectedDep);
        }