Пример #1
0
        /// <summary>
        /// Assert that two strings are the same using the configures asserter method. Upon a failure, a suggested string for correcting the test
        /// is printed.
        /// </summary>
        public void AreEqual(string expected, string actual)
        {
            if (expected == actual)
            {
                return;
            }

            var reflector = new CallStackReflector();
            var info      = reflector.TryGetLocation();

            CallUnderlyingAssert(expected, actual, info);
        }
Пример #2
0
        /// <summary>
        /// Assert that two strings are the same using the configures asserter method. Upon a failure, a suggested string for correcting the test
        /// is printed.
        /// </summary>
        public void AreEqual(string expected, string actual)
        {
            if (expected == actual)
            {
                return;
            }

            var escapedActual = Escape(actual);
            var newExpected   = string.Format("var expected = {0};", escapedActual);
            var message       = string.Format("{0}{0}Proposed output for unit test:{0}{0}{1}{0}", Environment.NewLine, newExpected);

            var reflector = new CallStackReflector();
            var info      = reflector.TryGetLocation();

            CallUnderlyingAssert(expected, actual, info, message, escapedActual);
        }
Пример #3
0
        /// <summary>
        /// Assert that two strings are the same using the configures asserter method. Upon a failure, a suggested string for correcting the test
        /// is printed. 
        /// </summary>
        public void AreEqual(string expected, string actual)
        {
            if (expected == actual)
                return;

            var reflector = new CallStackReflector();
            var info = reflector.TryGetLocation();

            CallUnderlyingAssert(expected, actual, info);
        }