本文整理汇总了C#中Builder.OnTag方法的典型用法代码示例。如果您正苦于以下问题:C# Builder.OnTag方法的具体用法?C# Builder.OnTag怎么用?C# Builder.OnTag使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Builder
的用法示例。
在下文中一共展示了Builder.OnTag方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BasicTag
public void BasicTag ()
{
var builder = new Builder ();
builder.OnTag (new Tag {
Title = "Foo Bar",
Track = 42
});
var objects = builder.OnDone ();
var music_track = objects[0] as MusicTrack;
Assert.AreEqual ("Foo Bar", music_track.Title);
Assert.AreEqual (42, music_track.OriginalTrackNumber);
}
示例2: BasicGenreTag
public void BasicGenreTag ()
{
var builder = new Builder ();
builder.OnTag (new Tag {
Title = "Foo Bar",
Track = 42,
Genres = new[] { "Bat" },
});
var objects = builder.OnDone ();
var music_track = objects[0] as MusicTrack;
Assert.AreEqual ("Foo Bar", music_track.Title);
Assert.AreEqual (42, music_track.OriginalTrackNumber);
Assert.AreEqual ("Bat", music_track.Genres[0]);
var reference = objects[1] as Item;
Assert.AreEqual (music_track.Id, reference.RefId);
var music_genre = objects[3] as MusicGenre;
Assert.AreEqual ("Bat", music_genre.Title);
Assert.AreEqual (1, music_genre.ChildCount);
}
示例3: BasicArtistAndGenreTag
public void BasicArtistAndGenreTag ()
{
var builder = new Builder ();
builder.OnTag (new Tag {
Title = "Foo Bar",
Track = 42,
Performers = new[] { "Boo Far" },
Genres = new[] { "Bat" }
});
var objects = builder.OnDone ();
var music_track = objects[0] as MusicTrack;
Assert.AreEqual ("Foo Bar", music_track.Title);
Assert.AreEqual (42, music_track.OriginalTrackNumber);
Assert.AreEqual ("Boo Far", music_track.Artists[0].Name);
Assert.AreEqual ("Bat", music_track.Genres[0]);
Assert.AreEqual (music_track.Id, ((Item)objects[1]).RefId);
Assert.AreEqual (music_track.Id, ((Item)objects[2]).RefId);
var music_genre = objects[4] as MusicGenre;
Assert.AreEqual ("Bat", music_genre.Title);
Assert.AreEqual (1, music_genre.ChildCount);
var music_artist = objects[6] as MusicArtist;
Assert.AreEqual ("Boo Far", music_artist.Title);
Assert.AreEqual (1, music_artist.ChildCount);
Assert.AreEqual ("Bat", music_artist.Genres[0]);
}
示例4: MultipleArtistAndGenreTags
public void MultipleArtistAndGenreTags ()
{
var builder = new Builder ();
builder.OnTag (new Tag {
Title = "Foo Bar",
Track = 42,
Performers = new[] { "Boo Far" },
Genres = new[] { "Bazz" }
});
builder.OnTag (new Tag {
Title = "Hurt",
Track = 1,
Performers = new[] { "Our Lady J" },
Genres = new[] { "Bazz", "Electro Gospel" }
});
var objects = builder.OnDone ();
var music_track = objects[0] as MusicTrack;
Assert.AreEqual ("Foo Bar", music_track.Title);
Assert.AreEqual (42, music_track.OriginalTrackNumber);
Assert.AreEqual ("Boo Far", music_track.Artists[0].Name);
Assert.AreEqual ("Bazz", music_track.Genres[0]);
Assert.AreEqual (music_track.Id, ((Item)objects[1]).RefId);
Assert.AreEqual (music_track.Id, ((Item)objects[2]).RefId);
music_track = objects[3] as MusicTrack;
Assert.AreEqual ("Hurt", music_track.Title);
Assert.AreEqual (1, music_track.OriginalTrackNumber);
Assert.AreEqual ("Our Lady J", music_track.Artists[0].Name);
Assert.AreEqual ("Bazz", music_track.Genres[0]);
Assert.AreEqual ("Electro Gospel", music_track.Genres[1]);
Assert.AreEqual (music_track.Id, ((Item)objects[4]).RefId);
Assert.AreEqual (music_track.Id, ((Item)objects[5]).RefId);
Assert.AreEqual (music_track.Id, ((Item)objects[6]).RefId);
var music_genre = objects[8] as MusicGenre;
Assert.AreEqual ("Bazz", music_genre.Title);
Assert.AreEqual (2, music_genre.ChildCount);
music_genre = objects[9] as MusicGenre;
Assert.AreEqual ("Electro Gospel", music_genre.Title);
Assert.AreEqual (1, music_genre.ChildCount);
var music_artist = objects[11] as MusicArtist;
Assert.AreEqual ("Boo Far", music_artist.Title);
Assert.AreEqual (1, music_artist.ChildCount);
Assert.AreEqual ("Bazz", music_artist.Genres[0]);
music_artist = objects[12] as MusicArtist;
Assert.AreEqual ("Our Lady J", music_artist.Title);
Assert.AreEqual (1, music_artist.ChildCount);
Assert.AreEqual ("Bazz", music_artist.Genres[0]);
Assert.AreEqual ("Electro Gospel", music_artist.Genres[1]);
}
示例5: MultipleGenresTag
public void MultipleGenresTag ()
{
var builder = new Builder ();
builder.OnTag (new Tag {
Title = "Foo Bar",
Track = 42,
Genres = new[] { "Bat", "Baz" },
});
var objects = builder.OnDone ();
var music_track = objects[0] as MusicTrack;
Assert.AreEqual ("Foo Bar", music_track.Title);
Assert.AreEqual (42, music_track.OriginalTrackNumber);
Assert.AreEqual ("Bat", music_track.Genres[0]);
Assert.AreEqual ("Baz", music_track.Genres[1]);
Assert.AreEqual (music_track.Id, ((Item)objects[1]).RefId);
Assert.AreEqual (music_track.Id, ((Item)objects[2]).RefId);
var music_genre = objects[4] as MusicGenre;
Assert.AreEqual ("Bat", music_genre.Title);
Assert.AreEqual (1, music_genre.ChildCount);
music_genre = objects[5] as MusicGenre;
Assert.AreEqual ("Baz", music_genre.Title);
Assert.AreEqual (1, music_genre.ChildCount);
}