Exemple #1
0
        public void GetHashCode_WhenFullNameOnRedditThingIsNull_ThrowsArgumentException()
        {
            IRedditThing redditThing = CreateRedditThing(fullNameIsNull: true);

            IRedditThingComparer <IRedditThing> sut = CreateSut();

            sut.GetHashCode(redditThing);
        }
Exemple #2
0
        public void GetHashCode_WhenRedditThingIsNull_ThrowsArgumentNullException()
        {
            const IRedditThing redditThing = null;

            IRedditThingComparer <IRedditThing> sut = CreateSut();

            sut.GetHashCode(redditThing);
        }
Exemple #3
0
        public void GetHashCode_WhenCalled_AssertFullNameWasCalledOnRedditThing()
        {
            Mock <IRedditThing> redditThingMock = CreateRedditThingMock();

            IRedditThingComparer <IRedditThing> sut = CreateSut();

            sut.GetHashCode(redditThingMock.Object);

            redditThingMock.Verify(m => m.FullName, Times.Once);
        }
Exemple #4
0
        public void GetHashCode_WhenCalled_ReturnsHashCodeForFullName()
        {
            string       fullName    = Guid.NewGuid().ToString("D");
            IRedditThing redditThing = CreateRedditThing(fullName: fullName);

            IRedditThingComparer <IRedditThing> sut = CreateSut();

            int result = sut.GetHashCode(redditThing);

            Assert.AreEqual(fullName.GetHashCode(), result);
        }