public bool Equals(DifferentTopic other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return(Equals(other.Name, Name)); }
public void caches_against_a_multiple_topic_families() { // All relatives of mine from the same family. In-law finally // rebelled and named a child "Parker" var topic1 = new FakeTopic { Name = "Tom" }; var topic2 = new FakeTopic { Name = "Todd" }; var topic3 = new DifferentTopic { Name = "Trevor" }; var topic4 = new DifferentTopic { Name = "Trent" }; ClassUnderTest.ChannelFor(topic1).ShouldNotBeNull(); ClassUnderTest.ChannelFor(topic1).ShouldBeTheSameAs(ClassUnderTest.ChannelFor(topic1)); ClassUnderTest.ChannelFor(topic1).ShouldBeTheSameAs(ClassUnderTest.ChannelFor(topic1)); ClassUnderTest.ChannelFor(topic1).ShouldBeTheSameAs(ClassUnderTest.ChannelFor(topic1)); ClassUnderTest.ChannelFor(topic2).ShouldBeTheSameAs(ClassUnderTest.ChannelFor(topic2)); ClassUnderTest.ChannelFor(topic1).ShouldNotBeTheSameAs(ClassUnderTest.ChannelFor(topic2)); ClassUnderTest.ChannelFor(topic3).ShouldBeTheSameAs(ClassUnderTest.ChannelFor(topic3)); ClassUnderTest.ChannelFor(topic4).ShouldBeTheSameAs(ClassUnderTest.ChannelFor(topic4)); ClassUnderTest.ChannelFor(topic3).ShouldNotBeTheSameAs(ClassUnderTest.ChannelFor(topic4)); }
public bool Equals(DifferentTopic other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return Equals(other.Name, Name); }