using UnitTestSharp; namespace Glass.UnitTests { public class FontAttributeTests : TestFixture { public class EqualsTests : TestFixture { public void MatchingSourcesAreEqual() { CheckTrue(new FontAttribute("foo.fnt").Equals(new FontAttribute("foo.fnt"))); } public void DifferentSourcesAreNotEqual() { CheckFalse(new FontAttribute("foo.fnt").Equals(new FontAttribute("bar.fnt"))); } public void OtherTypesAreNotEqual() { CheckFalse(new FontAttribute("foo.fnt").Equals("foo.fnt")); } public void NullIsNotEqual() { CheckFalse(new FontAttribute("foo.fnt").Equals(null)); } } public class GetHashCodeTests : TestFixture { public void MatchingSourcesShareAHashCode() { CheckEqual(new FontAttribute("foo.fnt").GetHashCode(), new FontAttribute("foo.fnt").GetHashCode()); } public void DifferentSourcesDoNotShareAHashCode() { CheckFalse(new FontAttribute("foo.fnt").GetHashCode() == new FontAttribute("bar.fnt").GetHashCode()); } public void ANullSourceDoesNotThrow() { new FontAttribute(null).GetHashCode(); } } } }