コード例 #1
0
        public void IsLessThanOrEqual_IsLessThanOrEqualUnitTest_Invoke_FalseIsReturned()

        {
            //init
            var comparer = new IsLessThanOrEqual();

            //exe
            var actual = comparer.Invoke(new[] { "100", "2" });

            //assert
            Assert.IsFalse(actual, "IsLessThanOrEqual returned the wrong result when comparing integers");
        }
コード例 #2
0
        // ReSharper disable InconsistentNaming
        public void IsLessThanOrEqual_IsLessThanOrEqualUnitTest_Invoke_TrueIsReturned()
        // ReSharper restore InconsistentNaming
        {
            //init
            var comparer = new IsLessThanOrEqual();

            //exe
            var actual = comparer.Invoke(new[] { "2", "100" });

            //assert
            Assert.IsTrue(actual, "IsLessThanOrEqual returned the wrong result when comparing integers");
        }
コード例 #3
0
        public void IsLessThanOrEqual_IsLessThanOrEqualUnitTest_InvokeWithEqualStrings_TrueIsReturned()

        {
            //init
            var comparer = new IsLessThanOrEqual();

            //exe
            var actual = comparer.Invoke(new[] { "2", "2" });

            //assert
            Assert.IsTrue(actual, "IsLessThanOrEqual returned the wrong result when comparing integers");

            //exe
            actual = comparer.Invoke(new[] { "SomeVal", "SomeVal" });
            //assert
            Assert.IsTrue(actual, "IsLessThanOrEqual returned the wrong result when comparing strings");

            //exe
            actual = comparer.Invoke(new[] { string.Empty });
            //assert
            Assert.IsFalse(actual, "IsLessThanOrEqual returned the wrong result when comparing empty string");
        }