public void TwoWayMappingTest() { //arrange Application expected = new Application(); expected.ID = 2; expected.Name = "Flucene"; expected.Description = @"Flucene - ORM for lucene.net. This project based on the opened sources of Iveonik Systems ltd. This library provide more fine mapping as compared with other existed libraries. Library's name was created as acronym of ""FLUent luCENE""."; expected.Category = new Category() { IsRoot = true, Name = "Security" }; expected.Version = new Version(1, 0, 0, 0); expected.ReleaseDate = DateTime.Today; expected.RegularPrice = 0.00m; expected.UpgradePrice = 59.95m; expected.Status = PublishStatus.Active; expected.Tags = new List<string>() { "lucene", "search", "ORM", "mapping" }; expected.AdditionalFields = new List<KeyValuePair<string, string>>() { new KeyValuePair<string, string>("Publisher", "Iveonik Systems Ltd."), new KeyValuePair<string, string>("License", "Apache License 2.0"), new KeyValuePair<string, string>("Language", "English") }; //action Document actualDoc = Target.GetDocument(expected); Application actual = Target.GetModel<Application>(actualDoc); //assert Assert.AreEqual(expected, actual); }
public virtual bool Equals(Application obj) { if (ID != obj.ID) return false; if (Name != obj.Name) return false; if (Version != obj.Version) return false; if (Description != obj.Description) return false; if (!Category.Equals(Category, obj.Category)) return false; if (RegularPrice != obj.RegularPrice) return false; if (UpgradePrice != obj.UpgradePrice) return false; if (ReleaseDate != obj.ReleaseDate) return false; if (Status != obj.Status) return false; if (!Enumerable.SequenceEqual(Tags, obj.Tags)) return false; return true; }