public void CreateGet() { // Arrange HomeController controller = new HomeController(tlsMock.Object); // Act ViewResult result = controller.Create() as ViewResult; // Assert Assert.IsNotNull(result); }
public void CreatePost() { // Arrange HomeController controller = new HomeController(tlsMock.Object); var log = new Log() { UserId = "doug", Billable = false, StartTime = DateTime.Now.AddHours(-1), EndTime = DateTime.Now, Comment = "test entry", }; // Act ViewResult result = controller.Create(log) as ViewResult; // Assert tlsMock.Verify(t => t.AddLog(It.Is<Log>(l => l.Equals(log))), Times.Once); }