本文整理汇总了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));
}
示例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));
}
示例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));
}
示例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));
}
示例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)));
}
示例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));
}
示例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));
}