public void InvalidationOfSomethingOnALinkTableInvalidatesSet() { Caching.Instances.Main.FlushAll(); Tag tag = new Tag() { TagText = "hello" }; tag.Update(); Photo photo = new Photo(); photo.Update(); Q where = new Q(TagPhoto.Columns.Disabled, false); Assert.AreEqual(0, tag.ChildPhotos(where).Count); TagPhoto tagPhoto = new TagPhoto() { PhotoK = photo.K, TagK = tag.K, Disabled = false}; tagPhoto.Update(); Assert.AreEqual(1, tag.ChildPhotos(where).Count); tagPhoto.Disabled = true; tagPhoto.Update(); Assert.AreEqual(0, tag.ChildPhotos(where).Count); }
public void LinkTablesWork() { //return; Caching.Instances.Main.FlushAll(); Tag tag = new Tag() { TagText = "hello" }; tag.Update(); List<Photo> photos = new List<Photo>(); for (int i = 0; i < 3; i++) { Photo photo = new Photo(); photo.Update(); photos.Add(photo); } for (int i = 0; i < photos.Count; i++) { Assert.AreEqual(i, tag.ChildPhotos().Count); TagPhoto tagPhoto = new TagPhoto() { PhotoK = photos[i].K, TagK = tag.K }; tagPhoto.Update(); } Assert.AreEqual(photos.Count, tag.ChildPhotos().Count); }