public void GetHashCode_WhenFullNameOnRedditThingIsNull_ThrowsArgumentException() { IRedditThing redditThing = CreateRedditThing(fullNameIsNull: true); IRedditThingComparer <IRedditThing> sut = CreateSut(); sut.GetHashCode(redditThing); }
public void GetHashCode_WhenRedditThingIsNull_ThrowsArgumentNullException() { const IRedditThing redditThing = null; IRedditThingComparer <IRedditThing> sut = CreateSut(); sut.GetHashCode(redditThing); }
public void GetHashCode_WhenCalled_AssertFullNameWasCalledOnRedditThing() { Mock <IRedditThing> redditThingMock = CreateRedditThingMock(); IRedditThingComparer <IRedditThing> sut = CreateSut(); sut.GetHashCode(redditThingMock.Object); redditThingMock.Verify(m => m.FullName, Times.Once); }
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); }