Пример #1
0
        public void WithObjectNone_ReturnsTrue()
        {
            var source = new None();
            var other  = new None();
            var result = source.Equals((object)other);

            Assert.True(result);
        }
Пример #2
0
        public void WithIMaybeNull_ThrowsArgumentNullException()
        {
            var    source = new None();
            IMaybe other  = null;

            // ReSharper disable once ExpressionIsAlwaysNull
            Assert.Throws <ArgumentNullException>(() => source.Equals(other));
        }
Пример #3
0
        public void WithIMaybeSome_ReturnsFalse()
        {
            var source = new None();
            var other  = Maybe <int> .Some(1);

            var result = source.Equals((IMaybe)other);

            Assert.False(result);
        }
Пример #4
0
        public void WithIMaybeNone_ReturnsTrue()
        {
            var source = new None();
            var other  = Maybe <int> .None();

            var result = source.Equals((IMaybe)other);

            Assert.True(result);
        }
Пример #5
0
        public void WithObjectMaybeSome_ReturnsFalse()
        {
            var source = new None();
            var other  = (object)Maybe <int> .Some(1);

            var result = source.Equals(other);

            Assert.False(result);
        }
Пример #6
0
        public void WithObjectMaybeNone_ReturnsTrue()
        {
            var source = new None();
            var other  = (object)Maybe <int> .None();

            var result = source.Equals(other);

            Assert.True(result);
        }
Пример #7
0
        public void WithObjectNull_ReturnsFalse()
        {
            var    source = new None();
            object other  = null;

            // ReSharper disable once ExpressionIsAlwaysNull
            var result = source.Equals(other);

            Assert.False(result);
        }