Пример #1
0
        public void StringifiesValueMonadCorrectly()
        {
            var monad   = new ValueMonad <Int32>(2020);
            var visitor = new StringifierVisitor <Int32>();

            var stringifyRes = monad.Accept(visitor);

            Assert.IsNotNull(stringifyRes);
            Assert.IsTrue(stringifyRes.Contains("2020", StringComparison.InvariantCultureIgnoreCase));
            Assert.IsTrue(stringifyRes.Contains("value", StringComparison.InvariantCultureIgnoreCase));
        }
        public void DifferentReturnStringValueIsNotEqual()
        {
            var value = "SomeVal";
            var monad = new ValueMonad <String>(value);

            var asserterVisitor = new AssertValueVisitor <String>
            {
                ExpectedValue = "SomeOtherVal",
                AreEqual      = false
            };

            monad.Accept(asserterVisitor);
        }
        public void ReturnStringValueIsEqual()
        {
            var value = "SomeVal";
            var monad = new ValueMonad <String>(value);

            var asserterVisitor = new AssertValueVisitor <String>
            {
                ExpectedValue = value,
                AreEqual      = true
            };

            monad.Accept(asserterVisitor);
        }
        public void DifferentReturnIntValueIsNotEqual()
        {
            var value = 2020;
            var monad = new ValueMonad <Int32>(value);

            var asserterVisitor = new AssertValueVisitor <Int32>
            {
                ExpectedValue = 0,
                AreEqual      = false
            };

            monad.Accept(asserterVisitor);
        }
        public void ReturnIntValueIsEqual()
        {
            var value = 2020;
            var monad = new ValueMonad <Int32>(value);

            var asserterVisitor = new AssertValueVisitor <Int32>
            {
                ExpectedValue = value,
                AreEqual      = true
            };

            monad.Accept(asserterVisitor);
        }