コード例 #1
0
        public void VerifyNavigationData(string suffix, string methodName, int minLineDebug, int minLineRelease, int maxLineRelease, int maxLineDebug)
        {
            // Get the navigation data - ensure names are spelled correctly!
            var className = Prefix + suffix;
            var data      = testConverter.GetNavigationData(className, methodName);

            Assert.NotNull(data, "Unable to retrieve navigation data");

            // Verify the navigation data
            // Note that different line numbers are returned for our
            // debug and release builds, as follows:
            //
            // DEBUG
            //   Min line: Opening curly brace.
            //   Max line: Closing curly brace.
            //
            // RELEASE
            //   Min line: First non-comment code line or closing
            //             curly brace if the method is empty.
            //   Max line: Last code line if that line is an
            //             unconditional return statement, otherwise
            //             the closing curly brace.
            Assert.That(data.FileName, Is.StringEnding("NavigationTestData.cs"));
#if DEBUG
            Assert.That(data.MinLineNumber, Is.EqualTo(minLineDebug));
            Assert.That(data.MaxLineNumber, Is.EqualTo(maxLineDebug));
#else
            Assert.That(data.MaxLineNumber, Is.EqualTo(maxLineRelease));
            Assert.That(data.MinLineNumber, Is.EqualTo(minLineRelease));
#endif
        }