示例#1
0
        public void GetHoliday_Default_ReturnView()
        {
            //Arrange
            SelectList expYearList    = controller.YearDropDownList();
            SelectList expCountryList = controller.CountryDropDownList();
            int        expCountryID   = controller.SelectDefaultCountryID();
            //Act
            var        result            = controller.GetHoliday();
            SelectList actualYearList    = ((ViewResult)result).ViewBag.YearDropdownList as SelectList;
            SelectList actualCountryList = ((ViewResult)result).ViewBag.CountryDropdownList as SelectList;

            //Assert
            Assert.IsInstanceOf(typeof(ViewResult), result);
            Assert.AreEqual("", ((ViewResult)result).ViewName);
            Assert.AreEqual(expYearList.Items, actualYearList.Items);
            Assert.AreEqual(expCountryList.Items, actualCountryList.Items);
            Assert.AreEqual(expCountryID, ((ViewResult)result).ViewBag.DefaultCountry);
        }