ToString() public method

public ToString ( ) : string
return string
コード例 #1
0
        public void Stack_CreateFromStackTrace()
        {
            var   dotNetStack = new StackTrace();
            Stack stack       = new Stack(dotNetStack);

            // The .NET StackTrace.ToString() override must preserve a trailing NewLine
            // for compatibility reasons. We do not retain this behavior in ToString()
            // but provide a facility for adding the trailing NewLine
            Assert.AreEqual(dotNetStack.ToString(), stack.ToString(StackFormat.TrailingNewLine));
        }
コード例 #2
0
        public void Stack_CreateFromStackTrace()
        {
            var   dotNetStack = new StackTrace();
            Stack stack       = new Stack(dotNetStack);

            // The .NET StackTrace.ToString() override must preserve a trailing NewLine
            // for compatibility reasons. We do not retain this behavior in ToString()
            // but provide a facility for adding the trailing NewLine
            stack.ToString(StackFormat.TrailingNewLine).Should().BeCrossPlatformEquivalentStrings(dotNetStack.ToString());
        }
コード例 #3
0
ファイル: StackTests.cs プロジェクト: Microsoft/sarif-sdk
        public void Stack_CreateFromStackTrace()
        {
            var dotNetStack = new StackTrace();
            Stack stack = new Stack(dotNetStack);

            // The .NET StackTrace.ToString() override must preserve a trailing NewLine
            // for compatibility reasons. We do not retain this behavior in ToString()
            // but provide a facility for adding the trailing NewLine
            Assert.AreEqual(dotNetStack.ToString(), stack.ToString(StackFormat.TrailingNewLine));
        }