I have set a test using Moq 3.0. I need to test a method that will change some value in that database. I am using ASP.NET MVC so I want to test my controller.
I setup this
// Generate an implementer of IProductsRepository at runtime using Moq
var mockTareasRepos = new Mock<IRepository>();
mockTareasRepos.Setup(x => x.ExecutedTask).Returns(tasks.AsQueryable());
return mockTareasRepos.Object;
I need to add a new method that get a taskId and change the value of a field in a list of tasks. Suppose that the value I need to change is StartTime that is a datetime, I need to set the value to null and I need to set that retrys value plus one.
this is the task Class
public class {
int taskId {get;set;}
DateTime StartTime {get;set;}
int retrys {get;set;}
}
How I do that?
mockTareasRepos.Setup(x => x.SetToExecuteTask(It.IsAny<int>()))
I hope you understand what I need, My English is not so good.