コード例 #1
0
        public void GetHashCode_When_TargetisNull_Then_ResultShouldNotBe0()
        {
            var testee = new TargetEqualityWeakReference <Target>(new Target());

            var result = testee.GetHashCode();

            result.Should().NotBe(0);
        }
コード例 #2
0
        public void Equals_When_Target1IsNull_Then_ResultShouldBeFalse()
        {
            var target2 = new Target();
            var testee  = new TargetEqualityWeakReference <Target>(null !);
            var testee2 = new TargetEqualityWeakReference <Target>(target2);

            var result = testee.Equals(testee2);

            result.Should().BeFalse();
        }
コード例 #3
0
        public void Equals_When_TargetsAreTheSame_Then_ResultShouldBeTrue()
        {
            var target  = new Target();
            var testee  = new TargetEqualityWeakReference <Target>(target);
            var testee2 = new TargetEqualityWeakReference <Target>(target);

            var result = testee.Equals(testee2);

            result.Should().BeTrue();
        }