当前位置: 首页>>代码示例>>C#>>正文


C# TermController.DeleteTerm方法代码示例

本文整理汇总了C#中DotNetNuke.Entities.Content.Taxonomy.TermController.DeleteTerm方法的典型用法代码示例。如果您正苦于以下问题:C# TermController.DeleteTerm方法的具体用法?C# TermController.DeleteTerm怎么用?C# TermController.DeleteTerm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DotNetNuke.Entities.Content.Taxonomy.TermController的用法示例。


在下文中一共展示了TermController.DeleteTerm方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TermController_DeleteTerm_Throws_On_Null_Term

        public void TermController_DeleteTerm_Throws_On_Null_Term()
        {
            //Arrange
            Mock<IDataService> mockDataService = new Mock<IDataService>();
            TermController termController = new TermController(mockDataService.Object);

            //Act, Arrange
            AutoTester.ArgumentNull<Term>(term => termController.DeleteTerm(term));
        }
开发者ID:neogic,项目名称:DotNetNuke_SVN,代码行数:9,代码来源:TermControllerTests.cs

示例2: TermController_DeleteTerm_Throws_On_Negative_TermId

        public void TermController_DeleteTerm_Throws_On_Negative_TermId()
        {
            //Arrange
            Mock<IDataService> mockDataService = new Mock<IDataService>();
            TermController termController = new TermController(mockDataService.Object);

            Term term = ContentTestHelper.CreateValidSimpleTerm(Constants.VOCABULARY_ValidVocabularyId);
            term.TermId = Null.NullInteger;

            //Act, Arrange
            Assert.Throws<ArgumentException>(() => termController.DeleteTerm(term));
        }
开发者ID:neogic,项目名称:DotNetNuke_SVN,代码行数:12,代码来源:TermControllerTests.cs

示例3: TermController_DeleteTerm_Should_Call_DataService_DeleteSimpleTerm_If_Term_Is_Simple_Term

        public void TermController_DeleteTerm_Should_Call_DataService_DeleteSimpleTerm_If_Term_Is_Simple_Term()
        {
            //Arrange
            Mock<IDataService> mockDataService = new Mock<IDataService>();
            TermController termController = new TermController(mockDataService.Object);

            Term term = ContentTestHelper.CreateValidSimpleTerm(Constants.VOCABULARY_ValidVocabularyId);
            term.TermId = Constants.TERM_DeleteTermId;

            // Act
            termController.DeleteTerm(term);

            // Assert
            mockDataService.Verify(ds => ds.DeleteSimpleTerm(term));
        }
开发者ID:neogic,项目名称:DotNetNuke_SVN,代码行数:15,代码来源:TermControllerTests.cs

示例4: TermController_DeleteTerm_Clears_Term_Cache_On_Valid_Term

        public void TermController_DeleteTerm_Clears_Term_Cache_On_Valid_Term()
        {
            //Arrange
            Mock<IDataService> mockDataService = new Mock<IDataService>();
            TermController termController = new TermController(mockDataService.Object);

            Term term = new Term(Constants.VOCABULARY_ValidVocabularyId) {TermId = Constants.TERM_DeleteTermId};

            //Act
            termController.DeleteTerm(term);

            //Assert
            mockCache.Verify(
                cache => cache.Remove(String.Format(Constants.TERM_CacheKey, Constants.VOCABULARY_ValidVocabularyId)));
        }
开发者ID:neogic,项目名称:DotNetNuke_SVN,代码行数:15,代码来源:TermControllerTests.cs

示例5: TermController_DeleteTerm_Should_Call_DataService_DeleteHeirarchicalTerm_If_Term_Is_Heirarchical_Term

        public void TermController_DeleteTerm_Should_Call_DataService_DeleteHeirarchicalTerm_If_Term_Is_Heirarchical_Term()
        {
            //Arrange
            var mockDataService = new Mock<IDataService>();
            var termController = new TermController(mockDataService.Object);

            var term = ContentTestHelper.CreateValidHeirarchicalTerm(Constants.VOCABULARY_HierarchyVocabularyId, Constants.TERM_ValidParentTermId);
            term.TermId = Constants.TERM_DeleteTermId;

            // Act
            termController.DeleteTerm(term);

            // Assert
            mockDataService.Verify(ds => ds.DeleteHeirarchicalTerm(term));
        }
开发者ID:biganth,项目名称:Curt,代码行数:15,代码来源:TermControllerTests.cs

示例6: TermController_DeleteTerm_Throws_On_Null_Term

        public void TermController_DeleteTerm_Throws_On_Null_Term()
        {
            //Arrange
            var mockDataService = new Mock<IDataService>();
            var termController = new TermController(mockDataService.Object);

            //Act, Arrange
            Assert.Throws<ArgumentNullException>(() => termController.DeleteTerm(null));
        }
开发者ID:biganth,项目名称:Curt,代码行数:9,代码来源:TermControllerTests.cs


注:本文中的DotNetNuke.Entities.Content.Taxonomy.TermController.DeleteTerm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。