I need help. I have this code in my unit test method.
My testMethod Code:
FormCollection fakeForm = new FormCollection();
fakeForm.Add("Id", "241");
fakeForm.Add("Description", "Unit Test");
target.ValueProvider = fakeForm.ToValueProvider();
var result = target.Insert() as ViewResult;
My Controller code:
public ActionResult Insert()
{
var newSelection = new Codes();
var insert = TryUpdateModel(newSelection);
if(insert)
{
//Save Method
}
else
{
//no Update
}
}
How do I need set insert true to pass my test case?
Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire