示例#1
0
        public void GetAllUserTest()
        {
            ProjectManagerBL tb     = new ProjectManagerBL(dbContext.Object);
            List <Users>     result = tb.GetAllUsers();

            Assert.AreEqual(result.Count, 3);
            Assert.AreEqual(result[1].UserId, 2);
            Assert.AreEqual(result[1].EmployeeId, "IT002");
            Assert.AreEqual(result[1].FirstName, "Kevin");
            Assert.AreEqual(result[1].LastName, "Pratt");
        }
        public void GetUserTestBL()
        {
            Mock <ProjectManagerDBEntities> mockContext = MockUserSP();
            var taskManagerBL            = new ProjectManagerBL(mockContext.Object);
            List <GetUsers_Result> users = taskManagerBL.GetAllUsers();

            NUnit.Framework.Assert.IsNotNull(users);
            foreach (var user in users)
            {
                Assert.IsNotNull(user.userId);
                Assert.IsNotNull(user.firstName);
                Assert.IsNotNull(user.lastName);
                Assert.IsNotNull(user.employeeId);
            }
        }
示例#3
0
        public void TestMethod3_GetAllUsers()
        {
            IEnumerable <Usr> lstUsers = new List <Usr>()
            {
                new Usr()
                {
                    Usr_ID = 100, FirstName = "Animesh", LastName = "Singh", Project_ID = 201, Task_ID = null, Employee_ID = 576113
                },
                new Usr()
                {
                    Usr_ID = 101, FirstName = "Shreya", LastName = "Singh", Project_ID = 201, Task_ID = 100, Employee_ID = 458965
                }
            };

            Mock <IProjectDbService> mock   = new Mock <IProjectDbService>();
            ProjectManagerBL         projBL = new ProjectManagerBL(mock.Object);

            mock.Setup(c => c.GetAllUsers()).Returns(lstUsers.AsQueryable());
            int expectedcount = 2;
            var actual        = projBL.GetAllUsers();

            Assert.AreEqual(expectedcount, actual.Count());
        }
示例#4
0
        public IHttpActionResult GetAllUsers()
        {
            ProjectManagerBL obj = new ProjectManagerBL(_db);

            return(Ok(obj.GetAllUsers()));
        }
示例#5
0
 public IEnumerable <GetUsers_Result> GetUsers()
 {
     return(pbl.GetAllUsers());
 }