コード例 #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);
        }