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


C# TermController.UpdateTerm方法代码示例

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


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

示例1: TermController_UpdateTerm_Throws_On_Negative_VocabularyId

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

            Term term = ContentTestHelper.CreateValidSimpleTerm(Null.NullInteger);

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

示例2: TermController_UpdateTerm_Throws_On_Null_Term

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

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

示例3: TermController_UpdateTerm_Throws_On_Invalid_Term

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

            Term term = ContentTestHelper.CreateValidSimpleTerm(Constants.VOCABULARY_ValidVocabularyId);
            term.Name = Constants.TERM_InValidName;

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

示例4: TermController_UpdateTerm_Should_Call_DataService_UpdateSimpleTerm_If_Term_Is_Simple_Term

        public void TermController_UpdateTerm_Should_Call_DataService_UpdateSimpleTerm_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_UpdateTermId;
            term.Name = Constants.TERM_UpdateName;
            term.Weight = Constants.TERM_UpdateWeight;

            // Act
            termController.UpdateTerm(term);

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

示例5: TermController_UpdateTerm_Clears_Term_Cache_On_Valid_Term

        public void TermController_UpdateTerm_Clears_Term_Cache_On_Valid_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_UpdateTermId;
            term.Name = Constants.TERM_UpdateName;
            term.Weight = Constants.TERM_UpdateWeight;

            //Act
            termController.UpdateTerm(term);

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

示例6: TermController_UpdateTerm_Throws_On_Null_Term

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

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

示例7: TermController_UpdateTerm_Should_Call_DataService_UpdateHeirarchicalTerm_If_Term_Is_Heirarchical_Term

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

            Term term = ContentTestHelper.CreateValidHeirarchicalTerm(Constants.VOCABULARY_HierarchyVocabularyId, Constants.TERM_ValidParentTermId);
            term.TermId = Constants.TERM_UpdateTermId;
            term.Name = Constants.TERM_UpdateName;
            term.Weight = Constants.TERM_UpdateWeight;

            // Act
            termController.UpdateTerm(term);

            // Assert
            mockDataService.Verify(ds => ds.UpdateHeirarchicalTerm(term, UserController.Instance.GetCurrentUserInfo().UserID));
        }
开发者ID:VegasoftTI,项目名称:Dnn.Platform,代码行数:17,代码来源:TermControllerTests.cs


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