示例#1
0
        public void GetCalendar_Null_SelectedDepartmentNull()
        {
            SelectList expDepartmentDropDownList = controller.DepartmentDropDownList();
            //Act
            var        result = controller.GetCalendar(null) as ViewResult;
            SelectList actDepartmentDropDownList = ((ViewResult)result).ViewBag.DepartmentDropDownList as SelectList;

            //Assert
            Assert.IsInstanceOf(typeof(ViewResult), result);
            Assert.AreEqual("", result.ViewName);
            Assert.AreEqual(expDepartmentDropDownList.ToArray().Length, actDepartmentDropDownList.ToArray().Length);
            Assert.AreEqual(expDepartmentDropDownList.ToArray()[0].Text, actDepartmentDropDownList.ToArray()[0].Text);
            Assert.AreEqual(expDepartmentDropDownList.ToArray()[3].Text, actDepartmentDropDownList.ToArray()[3].Text);
            Assert.AreEqual(expDepartmentDropDownList.ToArray()[6].Text, actDepartmentDropDownList.ToArray()[6].Text);
            Assert.AreEqual(null, result.ViewBag.SelectedDepartment);
        }
示例#2
0
        public async void TestGetCalendar()
        {
            Logic logic = new Logic();
            CalendarController calendarController = new CalendarController(null);


            var getCalendar = await calendarController.GetCalendar();

            Assert.NotNull(getCalendar);
        }