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); }