Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }