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