Ejemplo n.º 1
0
        public void AddUser()
        {
            UnitofWork.Setup(x => x.Repository <User>().Insert(It.IsAny <User>()));
            var result = Service.AddUser(new UserContract());

            Assert.IsNotNull(result);
        }
Ejemplo n.º 2
0
        public void AddTask()
        {
            UnitofWork.Setup(x => x.Repository <Task>().Insert(It.IsAny <Task>()));
            var result = Service.AddTask(new TaskContract());

            Assert.IsNotNull(result);
        }
Ejemplo n.º 3
0
        public void AddProject()
        {
            UnitofWork.Setup(x => x.Repository <Project>().Insert(It.IsAny <Project>()));
            UnitofWork.Setup(x => x.Repository <User>().Insert(It.IsAny <User>()));
            var result = Service.AddProject(new ProjectContract {
                Manager = new UserContract {
                }
            });

            Assert.IsNotNull(result);
        }
Ejemplo n.º 4
0
        public void GetTask()
        {
            UnitofWork.Setup(x => x.Repository <Task>().GetAllData()).Returns(new List <Task> {
                new Task {
                    Id = 1
                }
            });
            var result = Service.GetTasks();

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Count == 1);
        }
Ejemplo n.º 5
0
        public void GetUser()
        {
            UnitofWork.Setup(x => x.Repository <User>().GetAllData()).Returns(new List <User> {
                new User {
                    Id = 1
                }
            });
            var result = Service.GetUsers();

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Count == 1);
        }
Ejemplo n.º 6
0
        public void GetAllDataTest()
        {
            UnitofWork.Setup(x => x.Repository <Project>().GetAllData()).Returns(new List <Project> {
                new Project {
                    Id = 1
                }
            });
            var result = Service.GetProject();

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Count == 1);
        }