예제 #1
0
 public bool Equals(DifferentTopic other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Equals(other.Name, Name));
 }
예제 #2
0
        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));
        }
예제 #3
0
 public bool Equals(DifferentTopic other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other.Name, Name);
 }