3 overrides of FormatObject
Microsoft.CodeAnalysis.CSharp.Scripting (1)
Hosting\ObjectFormatter\CSharpObjectFormatter.cs (1)
22
public override string
FormatObject
(object obj, PrintOptions options) => s_impl.FormatObject(obj, options);
Microsoft.CodeAnalysis.Scripting (1)
Hosting\ObjectFormatter\CommonObjectFormatter.cs (1)
22
public override string
FormatObject
(object obj, PrintOptions options)
Microsoft.CodeAnalysis.VisualBasic.Scripting (1)
Hosting\ObjectFormatter\VisualBasicObjectFormatter.vb (1)
19
Public Overrides Function
FormatObject
(obj As Object, options As PrintOptions) As String
113 references to FormatObject
Microsoft.CodeAnalysis.CSharp.Scripting (1)
Hosting\ObjectFormatter\CSharpObjectFormatter.cs (1)
22
public override string FormatObject(object obj, PrintOptions options) => s_impl.
FormatObject
(obj, options);
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (7)
ObjectFormatterTests.cs (7)
27
var str = s_formatter.
FormatObject
(obj, SingleLineOptions);
40
var str = s_formatter.
FormatObject
(obj, SeparateLinesOptions);
55
var str = s_formatter.
FormatObject
(obj, SingleLineOptions);
67
var str = s_formatter.
FormatObject
(obj, SingleLineOptions);
79
var str = s_formatter.
FormatObject
(obj, SingleLineOptions);
85
str = s_formatter.
FormatObject
(obj, SingleLineOptions);
119
var str = s_formatter.
FormatObject
(obj, SeparateLinesOptions);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (72)
ObjectFormatterTests.cs (47)
37
str = s_formatter.
FormatObject
(nested, SingleLineOptions);
40
str = s_formatter.
FormatObject
(nested, HiddenOptions);
43
str = s_formatter.
FormatObject
(A<int>.X, HiddenOptions);
47
str = s_formatter.
FormatObject
(obj, HiddenOptions);
100
var str = s_formatter.
FormatObject
(o, HiddenOptions);
292
str = s_formatter.
FormatObject
(obj, SeparateLinesOptions);
300
str = s_formatter.
FormatObject
(obj, SeparateLinesOptions);
322
str = s_formatter.
FormatObject
(obj, SeparateLinesOptions);
332
str = s_formatter.
FormatObject
(obj, SingleLineOptions);
359
var actual = s_formatter.
FormatObject
(obj, printOptions);
370
var str = new TestCSharpObjectFormatter(maximumLineLength: 20).
FormatObject
(obj, SingleLineOptions);
373
str = new TestCSharpObjectFormatter(maximumLineLength: 20).
FormatObject
(obj, SeparateLinesOptions);
381
var str = s_formatter.
FormatObject
(obj, SeparateLinesOptions);
413
str = s_formatter.
FormatObject
(a, SingleLineOptions);
416
str = s_formatter.
FormatObject
(a, SeparateLinesOptions);
426
str = s_formatter.
FormatObject
(obj, SingleLineOptions);
430
str = s_formatter.
FormatObject
(x, SingleLineOptions);
434
str = s_formatter.
FormatObject
(y, SingleLineOptions);
438
str = s_formatter.
FormatObject
(z, SingleLineOptions);
449
str = s_formatter.
FormatObject
(obj, SingleLineOptions);
483
str = s_formatter.
FormatObject
(obj, SingleLineOptions);
510
str = s_formatter.
FormatObject
(obj, SingleLineOptions);
524
str = s_formatter.
FormatObject
(obj, SingleLineOptions);
527
str = s_formatter.
FormatObject
(obj, SeparateLinesOptions);
543
str = s_formatter.
FormatObject
(obj, SingleLineOptions);
552
var str = s_formatter.
FormatObject
(obj, SingleLineOptions);
564
var str = s_formatter.
FormatObject
(obj, SingleLineOptions);
576
var str = s_formatter.
FormatObject
(obj, SingleLineOptions);
588
var str = s_formatter.
FormatObject
(obj, SeparateLinesOptions);
594
str = s_formatter.
FormatObject
(obj, SingleLineOptions);
604
var str = s_formatter.
FormatObject
(obj, SingleLineOptions);
613
var str = s_formatter.
FormatObject
(obj, SingleLineOptions);
625
var str = s_formatter.
FormatObject
(obj, SingleLineOptions);
637
var str = s_formatter.
FormatObject
(obj, SingleLineOptions);
643
str = s_formatter.
FormatObject
(obj2, SingleLineOptions);
656
FormatObject
(obj, new PrintOptions { NumberRadix = ObjectFormatterHelpers.NumberRadixHexadecimal });
670
var str = s_formatter.
FormatObject
(obj, SingleLineOptions);
681
var str = s_formatter.
FormatObject
(obj, SingleLineOptions);
691
var str = s_formatter.
FormatObject
(obj, SingleLineOptions);
704
var str = s_formatter.
FormatObject
(obj, SingleLineOptions);
716
var str = s_formatter.
FormatObject
(obj, SingleLineOptions);
727
var str = s_formatter.
FormatObject
(obj, SingleLineOptions);
747
var str = s_formatter.
FormatObject
(obj, SingleLineOptions);
758
var str = s_formatter.
FormatObject
(obj, SingleLineOptions);
761
str = s_formatter.
FormatObject
(obj, SeparateLinesOptions);
771
str = s_formatter.
FormatObject
(obj, SingleLineOptions);
774
str = s_formatter.
FormatObject
(obj, SeparateLinesOptions);
PrintOptionsTests.cs (25)
21
Assert.Throws<ArgumentNullException>(() => s_formatter.
FormatObject
("hello", options: null));
50
Assert.Equal("10", formatter.
FormatObject
(10, options));
51
Assert.Equal("int[10] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }", formatter.
FormatObject
(new int[10], options));
52
Assert.Equal(@"16 '\u0010'", formatter.
FormatObject
('\u0010', options));
55
Assert.Equal("0x0000000a", formatter.
FormatObject
(10, options));
56
Assert.Equal("int[0x0000000a] { 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }", formatter.
FormatObject
(new int[10], options));
57
Assert.Equal(@"0x0010 '\u0010'", formatter.
FormatObject
('\u0010', options));
66
Assert.Equal("PrintOptions", s_formatter.
FormatObject
(options, options));
69
Assert.Equal("PrintOptions { Ellipsis=\"...\", EscapeNonPrintableCharacters=true, MaximumOutputLength=1024, MemberDisplayFormat=SingleLine, NumberRadix=10 }", s_formatter.
FormatObject
(options, options));
82
", s_formatter.
FormatObject
(options, options));
91
Assert.Equal(@"""\t""", s_formatter.
FormatObject
("\t", options));
92
Assert.Equal(@"'\t'", s_formatter.
FormatObject
('\t', options));
95
Assert.Equal("\"\t\"", s_formatter.
FormatObject
("\t", options));
96
Assert.Equal("'\t'", s_formatter.
FormatObject
('\t', options));
105
Assert.Equal("1...", s_formatter.
FormatObject
(123456, options));
108
Assert.Equal("12...", s_formatter.
FormatObject
(123456, options));
111
Assert.Equal("123...", s_formatter.
FormatObject
(123456, options));
114
Assert.Equal("1234...", s_formatter.
FormatObject
(123456, options));
117
Assert.Equal("12345...", s_formatter.
FormatObject
(123456, options));
120
Assert.Equal("123456", s_formatter.
FormatObject
(123456, options));
123
Assert.Equal("123456", s_formatter.
FormatObject
(123456, options));
133
Assert.Equal("1.", s_formatter.
FormatObject
(123456, options));
136
Assert.Equal("1..", s_formatter.
FormatObject
(123456, options));
139
Assert.Equal("1", s_formatter.
FormatObject
(123456, options));
142
Assert.Equal("1", s_formatter.
FormatObject
(123456, options));
Microsoft.CodeAnalysis.Scripting (3)
Hosting\CommandLine\CommandLineScriptGlobals.cs (1)
39
_outputWriter.WriteLine(_objectFormatter.
FormatObject
(value, PrintOptions));
Hosting\InteractiveScriptGlobals.cs (1)
39
_outputWriter.WriteLine(_objectFormatter.
FormatObject
(value, PrintOptions));
Hosting\ObjectFormatter\ObjectFormatter.cs (1)
16
public string FormatObject(object obj) =>
FormatObject
(obj, new PrintOptions());
Microsoft.CodeAnalysis.VisualBasic.Scripting (1)
Hosting\ObjectFormatter\VisualBasicObjectFormatter.vb (1)
20
Return s_impl.
FormatObject
(obj, options)
Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests (29)
ObjectFormatterTests.vb (10)
41
str = s_formatter.
FormatObject
(nested, SingleLineOptions)
44
str = s_formatter.
FormatObject
(nested, HiddenOptions)
51
str = s_formatter.
FormatObject
(obj, HiddenOptions)
55
str = New TestVisualBasicObjectFormatter(maximumLineLength:=51).
FormatObject
(sort, SingleLineOptions)
59
str = New TestVisualBasicObjectFormatter(maximumLineLength:=5).
FormatObject
(sort, SingleLineOptions)
63
str = New TestVisualBasicObjectFormatter(maximumLineLength:=4).
FormatObject
(sort, SingleLineOptions)
66
str = New TestVisualBasicObjectFormatter(maximumLineLength:=3).
FormatObject
(sort, SingleLineOptions)
69
str = New TestVisualBasicObjectFormatter(maximumLineLength:=2).
FormatObject
(sort, SingleLineOptions)
72
str = New TestVisualBasicObjectFormatter(maximumLineLength:=1).
FormatObject
(sort, SingleLineOptions)
75
str = New TestVisualBasicObjectFormatter(maximumLineLength:=80).
FormatObject
(sort, SingleLineOptions)
PrintOptionsTests.vb (19)
18
Assert.Throws(Of ArgumentNullException)(Sub() s_formatter.
FormatObject
("hello", options:=Nothing))
59
Assert.Equal("10", s_formatter.
FormatObject
(10, options))
60
Assert.Equal("Integer(10) { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }", s_formatter.
FormatObject
(array, options))
64
Assert.Equal("&H0000000A", s_formatter.
FormatObject
(10, options))
65
Assert.Equal("Integer(&H0000000A) { &H00000000, &H00000000, &H00000000, &H00000000, &H00000000, &H00000000, &H00000000, &H00000000, &H00000000, &H00000000 }", s_formatter.
FormatObject
(array, options))
74
Assert.Equal("PrintOptions", s_formatter.
FormatObject
(options, options))
77
Assert.Equal("PrintOptions { Ellipsis=""..."", EscapeNonPrintableCharacters=True, MaximumOutputLength=1024, MemberDisplayFormat=SingleLine, NumberRadix=10 }", s_formatter.
FormatObject
(options, options))
90
", s_formatter.
FormatObject
(options, options))
111
Assert.Equal("1...", s_formatter.
FormatObject
(123456, options))
114
Assert.Equal("12...", s_formatter.
FormatObject
(123456, options))
117
Assert.Equal("123...", s_formatter.
FormatObject
(123456, options))
120
Assert.Equal("1234...", s_formatter.
FormatObject
(123456, options))
123
Assert.Equal("12345...", s_formatter.
FormatObject
(123456, options))
126
Assert.Equal("123456", s_formatter.
FormatObject
(123456, options))
129
Assert.Equal("123456", s_formatter.
FormatObject
(123456, options))
138
Assert.Equal("1.", s_formatter.
FormatObject
(123456, options))
141
Assert.Equal("1..", s_formatter.
FormatObject
(123456, options))
144
Assert.Equal("1", s_formatter.
FormatObject
(123456, options))
147
Assert.Equal("1", s_formatter.
FormatObject
(123456, options))