public void LanguageStringComparer_CorrectlyComparesLanguageStrings() { const string firstValue = "Value 1"; const string frenchValue = "This is the french value."; LanguageString ls1 = new LanguageString { Iso3LanguageId = "eng", Value = firstValue }; LanguageString ls2 = new LanguageString { Iso3LanguageId = "eng", Value = "This is the second value." }; LanguageString ls3 = new LanguageString { Iso3LanguageId = "fra", Value = frenchValue }; LanguageStringCollection hs = new LanguageStringCollection(); var first = hs.Add(ls1); // this one should be added var second = hs.Add(ls2); // this one should not be added, it is a duplicate var third = hs.Add(ls3); // this one should be added Assert.IsTrue(first); Assert.IsFalse(second); Assert.IsTrue(third); Assert.AreEqual(2, hs.Count); Assert.AreEqual(firstValue, hs.First(ls => ls.Iso3LanguageId == "eng").Value); Assert.AreEqual(frenchValue, hs.First(ls => ls.Iso3LanguageId == "fra").Value); }
/// <summary>Constructor</summary> /// <param name="fullFileNameAndPath"></param> public ArchivingFile(string fullFileNameAndPath) { // check if the path is correct if (!File.Exists(fullFileNameAndPath)) throw new FileNotFoundException(fullFileNameAndPath); _fullName = fullFileNameAndPath; _descriptions = new LanguageStringCollection(); }