Example #1
0
        public void OpEquality()
        {
            var leftEither  = EitherExtensions.AsRight <int, string>("12");
            var rightEither = EitherExtensions.AsRight <int, string>("12");

            (leftEither == rightEither).Should().BeTrue();
        }
Example #2
0
        public void OpEqualityReferenceType()
        {
            var list = new List <string> {
                "1", "2"
            };
            var leftEither  = EitherExtensions.AsRight <int, List <string> >(list);
            var rightEither = EitherExtensions.AsRight <int, List <string> >(list);

            (leftEither == rightEither).Should().BeTrue();
        }
Example #3
0
        public void GetHashCodeReturnsHashCodeOfRightValue()
        {
            var rightEither = EitherExtensions.AsRight <int, string>("12");

            rightEither.GetHashCode().Should().Be("12".GetHashCode());
        }