Guest User

Untitled

a guest
Jul 21st, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. public class Model
  2. {
  3. public int Id {get;set;}
  4. public string Name {get; set;}
  5.  
  6. public void myAction(MyDatabase db, string r, string i) {
  7. db.DataEmp.Add(new DataEmp{
  8. Id = this.Id,
  9. DateOfAction = DateTime.UtcNow,
  10. R = r,
  11. I = i
  12. });
  13. db.SaveChanges();
  14. }
  15. }
  16.  
  17. [Test]
  18. public void Method_Test_Pass_myAction()
  19. {
  20. newModel.myAction(db,"R","I");
  21.  
  22. Assert.That(db.DataEmp.FirstOrDefault(de => de.Id == newModel.Id), Is.Null);
  23. }
Add Comment
Please, Sign In to add comment