Beispiel #1
0
        public void GetHashCode_SourceIsDefaultAndOtherSuccessIsNullAndTypesAreNotSame_ExpectHashCodesAreNotEqual()
        {
            var source = new SuccessBuilder <SomeRecord?>();
            var other  = Result.Success <object?>(null);

            var sourceHashCode = source.GetHashCode();
            var otherHashCode  = other.GetHashCode();

            Assert.AreNotEqual(sourceHashCode, otherHashCode);
        }
Beispiel #2
0
        public void GetHashCode_SourceSuccessIsDefaultAndOtherIsDefaultAndTypesAreSame_ExpectHashCodesAreEqual()
        {
            var source = Result.Success(default(SomeError));
            var other  = new SuccessBuilder <SomeError>();

            var sourceHashCode = source.GetHashCode();
            var otherHashCode  = other.GetHashCode();

            Assert.AreEqual(sourceHashCode, otherHashCode);
        }
Beispiel #3
0
        public void GetHashCode_SourceIsDefaultAndOtherIsDefaultAndTypesAreNotSame_ExpectHashCodesAreNotEqual()
        {
            var source = new SuccessBuilder <int>();
            var other  = new SuccessBuilder <int?>();

            var sourceHashCode = source.GetHashCode();
            var otherHashCode  = other.GetHashCode();

            Assert.AreNotEqual(sourceHashCode, otherHashCode);
        }
Beispiel #4
0
        public void GetHashCode_SourceIsDefaultAndOtherIsNotDefaultAndTypesAreSame_ExpectHashCodesAreNotEqual()
        {
            var source = new SuccessBuilder <RefType>();
            var other  = Result.Success <RefType>(new());

            var sourceHashCode = source.GetHashCode();
            var otherHashCode  = other.GetHashCode();

            Assert.AreNotEqual(sourceHashCode, otherHashCode);
        }