public void DataBoxGetTagsByName() { //Arrange var data = new DataBox("test.dat"); var tag = data.NewTag("tag"); //Act Tag[] tags = data.GetTagsByName("tag"); //Assert Assert.AreEqual(tag, tags[0]); }
public void DataBoxGetEntriesByLinkTag() { //Arrange var data = new DataBox("test.dat"); var entry = data.NewLinkEntry("entry", "description"); entry.AddLink("link", "test.ca").AddTag(data.NewTag("tag", "link")); //Act var entries = data.GetEntriesByLinkTag(data.GetTagsByName("tag", "link")[0]); //Assert Assert.AreEqual(entry, entries[0]); }
public void DataBoxGetTagsByNameMulti() { //Arrange var data = new DataBox("test.dat"); var tag = data.NewTag("tag"); var tag2 = data.NewTag("tag", "subTag"); //Act Tag[] tags = data.GetTagsByName("tag"); //Assert Assert.IsTrue(tags.Any(x => x == tag)); Assert.IsTrue(tags.Any(x => x == tag2)); }