public void TermController_RemoveTermsFromContent_Should_Call_DataService_If_Valid_Params() { //Arrange Mock<IDataService> mockDataService = new Mock<IDataService>(); TermController termController = new TermController(mockDataService.Object); ContentItem content = ContentTestHelper.CreateValidContentItem(); // Act termController.RemoveTermsFromContent(content); // Assert mockDataService.Verify(ds => ds.RemoveTermsFromContent(content)); }
public void TermController_RemoveTermsFromContent_Throws_On_Null_ContentItem() { //Arrange Mock<IDataService> mockDataService = new Mock<IDataService>(); TermController termController = new TermController(mockDataService.Object); //Act, Arrange AutoTester.ArgumentNull<ContentItem>(content => termController.RemoveTermsFromContent(content)); }
public void TermController_RemoveTermsFromContent_Throws_On_Null_ContentItem() { //Arrange var mockDataService = new Mock<IDataService>(); var termController = new TermController(mockDataService.Object); //Act, Arrange Assert.Throws<ArgumentNullException>(() => termController.RemoveTermsFromContent(null)); }