public void Hashing() { var a = new Text("en", "hello world"); var b = new Text("en", "hello world"); var c = new Text("en-AU", "g'day mate"); Assert.AreEqual(a.GetHashCode(), b.GetHashCode()); Assert.AreNotEqual(a.GetHashCode(), c.GetHashCode()); ExceptionAssert.Throws<InvalidOperationException>(() => new Text().GetHashCode()); }
public void LanguageTagsAreCaseInsensitive() { var t1 = new Text("en", "hello world"); var t2 = new Text("EN", "hello world"); Assert.AreEqual(t1, t2); Assert.AreEqual(t1.GetHashCode(), t2.GetHashCode()); }