本文整理汇总了C#中Catalog.AddContent方法的典型用法代码示例。如果您正苦于以下问题:C# Catalog.AddContent方法的具体用法?C# Catalog.AddContent怎么用?C# Catalog.AddContent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Catalog
的用法示例。
在下文中一共展示了Catalog.AddContent方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TestAddContent_WithDuplicateItem
public void TestAddContent_WithDuplicateItem()
{
Catalog catalog = new Catalog();
Content firstItem = new Content(ContentType.Book, new string[] { "Intro C#", "S.Nakov", "12763892", "http://www.introprogramming.info" });
Content secondItem = new Content(ContentType.Book, new string[] { "Intro C#", "S.Nakov", "12763892", "http://www.introprogramming.info" });
catalog.AddContent(firstItem);
catalog.AddContent(secondItem);
Assert.AreEqual(2, catalog.Count);
}
示例2: TestAddContent_WithDifferentItemTypes
public void TestAddContent_WithDifferentItemTypes()
{
Catalog catalog = new Catalog();
Content firstItem = new Content(ContentType.Book, new string[] { "Intro C#", "S.Nakov", "12763892", "http://www.introprogramming.info" });
Content secondItem = new Content(ContentType.Movie, new string[] { "Rocky", "Sylvester Stalone", "1353151", "http://www.rockymovie.info" });
Content thirdItem = new Content(ContentType.Song, new string[] { "Master of puppets", "Metallica", "2342332", "http://www.metallica.info" });
catalog.AddContent(firstItem);
catalog.AddContent(secondItem);
catalog.AddContent(thirdItem);
Assert.AreEqual(3, catalog.Count);
}
示例3: TestUpdatedContent_WithValidUrl
public void TestUpdatedContent_WithValidUrl()
{
Catalog catalog = new Catalog();
Content firstItem = new Content(ContentType.Book, new string[] { "Intro C#", "S.Nakov", "12763892", "http://www.introprogramming.info" });
Content secondItem = new Content(ContentType.Book, new string[] { "Intro C#", "S.Nakov", "12763892", "http://www.introprogramming.info" });
Content thirdItem = new Content(ContentType.Song, new string[] { "Master of puppets", "Metallica", "2342332", "http://www.metallica.info" });
catalog.AddContent(firstItem);
catalog.AddContent(secondItem);
catalog.AddContent(thirdItem);
var result = catalog.UpdatedContent("http://www.introprogramming.info", "http://www.introprogramming.se");
Assert.AreEqual(2, result);
}
示例4: TestAddAndFindFromMultipleItems
public void TestAddAndFindFromMultipleItems()
{
Catalog catalog = new Catalog();
Content firstItem = new Content(ContentType.Book, new string[] { "Intro C#", "S.Nakov", "12763892", "http://www.introprogramming.info" });
Content secondItem = new Content(ContentType.Book, new string[] { "Intro C#", "S.Nakov", "12763892", "http://www.introprogramming.info" });
Content thirdItem = new Content(ContentType.Song, new string[] { "Master of puppets", "Metallica", "2342332", "http://www.metallica.info" });
catalog.AddContent(firstItem);
catalog.AddContent(secondItem);
catalog.AddContent(thirdItem);
var contentList = catalog.GetListContent("Intro C#", 3);
Assert.AreEqual(3, catalog.Count);
Assert.AreEqual(2, contentList.Count());
Assert.AreSame(contentList.ElementAt(0), firstItem);
Assert.AreSame(contentList.ElementAt(1), secondItem);
}
示例5: TestAddContent_WithSingleItem
public void TestAddContent_WithSingleItem()
{
Catalog catalog = new Catalog();
Content item = new Content(ContentType.Book, new string[] { "Intro C#", "S.Nakov", "12763892", "http://www.introprogramming.info" });
catalog.AddContent(item);
Assert.AreEqual(1, catalog.Count);
}
示例6: TestAddAndFindItem
public void TestAddAndFindItem()
{
Catalog catalog = new Catalog();
Content item = new Content(ContentType.Book, new string[]{"Intro C#", "S.Nakov", "12763892", "http://www.introprogramming.info"});
catalog.AddContent(item);
var contentList = catalog.GetListContent("Intro C#", 1);
Assert.AreEqual(1, contentList.Count());
Assert.AreSame(contentList.ElementAt(0), item);
}