public void AddUser() { UnitofWork.Setup(x => x.Repository <User>().Insert(It.IsAny <User>())); var result = Service.AddUser(new UserContract()); Assert.IsNotNull(result); }
public void AddTask() { UnitofWork.Setup(x => x.Repository <Task>().Insert(It.IsAny <Task>())); var result = Service.AddTask(new TaskContract()); Assert.IsNotNull(result); }
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); }
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); }
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); }
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); }