Reputation: 2754
having some problems with my NUnit. I have this TestFixture testing a model
model is like this:
public class Model
{
public int Id {get;set;}
public string Name {get; set;}
public void myAction(MyDatabase db, string r, string i) {
db.DataEmp.Add(new DataEmp{
Id = this.Id,
DateOfAction = DateTime.UtcNow,
R = r,
I = i
});
db.SaveChanges();
}
}
My TestCase in NUnit
[Test]
public void Method_Test_Pass_myAction()
{
newModel.myAction(db,"R","I");
Assert.That(db.DataEmp.FirstOrDefault(de => de.Id == newModel.Id), Is.Null);
}
It's giving me a
System.NotImplementedException : The method or operation is not implemented.
So I'm not sure what's wrong, as I instantiated the newModel at the Setup method. And the method is running well if run the app. Thoughts are appreciated.
Thanks!!
Upvotes: 0
Views: 1937
Reputation: 20802
First try running it in Debug to see where you are throwing the exception, my guess is something is wrong with your MyDatabase
Upvotes: 2