示例#1
0
        public void TestIsUserValidToDelete_ReturnFalseWhenUserContainsActiveTasks()
        {
            var mockRepository = new Mock <IUserRepository>();
            var manageUser     = new ManageUser(mockRepository.Object, fixture.ManageUserLogger);

            var taskDetail = new TaskDetail()
            {
                Id = 1, Name = "Task 1", Priority = 20, ActiveStatus = true
            };

            var taskDetailsList = new List <TaskDetail>()
            {
                taskDetail,
                new TaskDetail()
                {
                    Id = 2, Name = "Task 2 ", Priority = 20
                },
            };

            var user = new User()
            {
                UserId = 1, FirstName = "User 1", TaskDetails = taskDetailsList, Projects = new List <Project>()
            };

            var result = manageUser.IsUserValidToDelete(user);

            Assert.False(result);
        }
示例#2
0
        public void TesIsUserValidToDelete_ReturnFalseWhenUserContainsActiveProjects()
        {
            var mockRepository = new Mock <IUserRepository>();
            var manageUser     = new ManageUser(mockRepository.Object, fixture.ManageUserLogger);

            var project = new Project()
            {
                ProjectId = 1, ProjectName = "Project 1", Priority = 20
            };

            var projectList = new List <Project>()
            {
                project
            };

            var user = new User()
            {
                UserId = 1, FirstName = "User 1", Projects = projectList, TaskDetails = new List <TaskDetail>()
            };

            var result = manageUser.IsUserValidToDelete(user);

            Assert.False(result);
        }