Exemple #1
0
        public void ShouldGetEmployeesLeaveWithGivenManagerId()
        {
            uowMock.Setup(x => x.Employees.GetWhere(It.IsAny <Expression <Func <Employee, bool> > >()))
            .Returns(DataUtilities.GetListOfMockedEmployees().AsQueryable());
            uowMock.Setup(x => x.Leaves.GetAllIncluding(It.IsAny <Expression <Func <Leave, bool> > >(), It.IsAny <Expression <Func <Leave, object> > >()))
            .Returns(DataUtilities.GetListOfMockedLeaves().AsQueryable());
            var manager = new LeaveManager(uowMock.Object, publicHolidaysManager.Object);
            var results = manager.GetManagerEmployeesLeaves(DataUtilities.id);

            var expectedResults = DataUtilities.GetListOfMockedLeaves();

            Assert.AreEqual(expectedResults.Count(), results.Count());
        }