Пример #1
0
        public void Add_ReturnsExpectedResult(Process.Models.Employee expectedResult)
        {
            Process.Models.Employee ProcessEmployee = ProcessEmployeeTest;
            mockEmployeeDAL = new Mock <DAL.Interfaces.IEmployeeDAL>(MockBehavior.Strict);
            mockEmployeeDAL.Setup(a => a.Add(It.IsAny <DAL.Models.Employee>())).Returns(DALEmployeeTest);

            processUnderTest = new Process.EmployeeProcess(mapper, mockEmployeeDAL.Object);
            Process.Models.Employee result = processUnderTest.Add(ProcessEmployee);


            Assert.IsTrue(result.ToString() == expectedResult.ToString());
        }
Пример #2
0
        public void GetById_ReturnsExpectedResult(Process.Models.Employee expectedResult)
        {
            int id = 1;

            //Process.Models.Employee expectedResult = ProcessEmployeeTest;
            mockEmployeeDAL = new Mock <DAL.Interfaces.IEmployeeDAL>(MockBehavior.Strict);
            mockEmployeeDAL.Setup(a => a.GetByID(id)).Returns(DALEmployeeTest);

            processUnderTest = new Process.EmployeeProcess(mapper, mockEmployeeDAL.Object);
            var result = processUnderTest.GetById(id);

            Assert.IsTrue(result.ToString() == expectedResult.ToString());
        }