Example #1
0
        public void SortFactorDataByStartDate_FactorDetailsEmpty_NoException()
        {
            //Arrange
            WTRViewModel model = new WTRViewModel(mock.Object.Employees[0], new DateTime(1990, 02, 21), new DateTime(1990, 02, 22));

            //Act
            model.SortFactorDataByStartDate();

            //Assert
            CollectionAssert.IsEmpty(model.FactorDetails);
        }
Example #2
0
        public void SortFactorDataByStartDate_FactorDetailsNull_NoException()
        {
            //Arrange
            WTRViewModel model = new WTRViewModel();

            //Act
            model.SortFactorDataByStartDate();

            //Assert
            Assert.IsNull(model.FactorDetails);
        }
Example #3
0
        public void SortFactorDataByStartDate_FactorDetailsNotEmpty_SortedFactorDetails()
        {
            //Arrange
            WTRViewModel model = new WTRViewModel(mock.Object.Employees[0], new DateTime(2014, 02, 20), new DateTime(2014, 02, 22));

            model.FactorDetails.Reverse();
            List <FactorData> factorDetails = new List <FactorData>();

            foreach (FactorData factorData in model.FactorDetails)
            {
                factorDetails.Add(factorData);
            }
            //Act
            model.SortFactorDataByStartDate();

            //Assert
            CollectionAssert.AreEquivalent(model.FactorDetails, factorDetails);
            CollectionAssert.AreNotEqual(model.FactorDetails, factorDetails);
        }