public async Task CreatePostAction_AddModelToService() { // Arrange // Act var result = await validController.Create(entity); // Assert mock.Verify(a => a.AddAsync(entity)); }
public async Task CreatePostAction_ModelError_ReturnsSameModel() { // Arrange // Act var result = await notValidController.Create(entity) as ViewResult; // Assert Assert.Equal(entity, result.Model); }
public void Create_ReturnsEmptyView() { ViewResult actual = controller.Create(); Assert.Null(actual.Model); }