102 references to FormatValue
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider.UnitTests (50)
ValueFormattingTests.cs (50)
249Assert.Equal("{void}", FormatValue(null, typeof(void))); 282Assert.Equal("0", FormatValue(0, type)); 283Assert.Equal("A", FormatValue(1, type)); 284Assert.Equal("B", FormatValue(2, type)); 285Assert.Equal("3", FormatValue(3, type)); 302Assert.Equal("0", FormatValue(0, type)); 303Assert.Equal("A", FormatValue(-1, type)); 304Assert.Equal("B", FormatValue(-2, type)); 305Assert.Equal("-3", FormatValue(-3, type)); 329Assert.Equal("A", FormatValue(1, e1)); 330Assert.Equal("A", FormatValue(1, e2)); 350Assert.Equal("0", FormatValue(0, type)); 351Assert.Equal("A", FormatValue(1, type)); 352Assert.Equal("B", FormatValue(2, type)); 353Assert.Equal("A | B", FormatValue(3, type)); 354Assert.Equal("4", FormatValue(4, type)); 375Assert.Equal("None", FormatValue(0, type)); 376Assert.Equal("A", FormatValue(1, type)); 377Assert.Equal("B", FormatValue(2, type)); 378Assert.Equal("A | B", FormatValue(3, type)); 379Assert.Equal("4", FormatValue(4, type)); 401Assert.Equal("None", FormatValue(0, type)); 402Assert.Equal("A", FormatValue(1, type)); 403Assert.Equal("B", FormatValue(2, type)); 404Assert.Equal("C", FormatValue(3, type)); 405Assert.Equal("4", FormatValue(4, type)); 426Assert.Equal("None", FormatValue(0, type)); 427Assert.Equal("A", FormatValue(-1, type)); 428Assert.Equal("B", FormatValue(-2, type)); 429Assert.Equal("-3", FormatValue(-3, type)); 430Assert.Equal("-4", FormatValue(-4, type)); 462Assert.Equal("0", FormatValue(0, e1)); 463Assert.Equal("A", FormatValue(1, e1)); 464Assert.Equal("C", FormatValue(2, e1)); 465Assert.Equal("A | C", FormatValue(3, e1)); 467Assert.Equal("0", FormatValue(0, e2)); 468Assert.Equal("A", FormatValue(1, e2)); 469Assert.Equal("C", FormatValue(2, e2)); 470Assert.Equal("A | C", FormatValue(3, e2)); 511Assert.Equal("0x00000001", FormatValue(1, pointerType, useHexadecimal: false)); // In hex, regardless. 512Assert.Equal("0x00000001", FormatValue(1, pointerType, useHexadecimal: true)); 514Assert.Equal("0xffffffff", FormatValue(-1, doublePointerType, useHexadecimal: false)); // In hex, regardless. 515Assert.Equal("0xffffffff", FormatValue(-1, doublePointerType, useHexadecimal: true)); 544Assert.Equal("null", FormatValue(null, nullableConstructedType)); 545Assert.Equal("{ToString() called.}", FormatValue(constructedType.Instantiate(), nullableConstructedType)); 547Assert.Equal("null", FormatValue(null, nullableInt)); 548Assert.Equal("1", FormatValue(1, nullableInt)); 576Assert.Equal("null", FormatValue(null, typeA)); 577Assert.Equal("null", FormatValue(null, typeB)); 578Assert.Equal("null", FormatValue(null, typeC));
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (2)
ResultProviderTestBase.cs (2)
114return FormatValue(null, typeof(T), useHexadecimal); 119return FormatValue(value, value.GetType(), useHexadecimal);
Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator.ResultProvider.UnitTests (50)
ValueFormatterTests.vb (50)
202Assert.Equal("{System.Void}", FormatValue(Nothing, GetType(Void))) 231Assert.Equal("0", FormatValue(0, type)) 232Assert.Equal("A {1}", FormatValue(1, type)) 233Assert.Equal("B {2}", FormatValue(2, type)) 234Assert.Equal("3", FormatValue(3, type)) 249Assert.Equal("0", FormatValue(0, type)) 250Assert.Equal("A {-1}", FormatValue(-1, type)) 251Assert.Equal("B {-2}", FormatValue(-2, type)) 252Assert.Equal("-3", FormatValue(-3, type)) 274Assert.Equal("A {1}", FormatValue(1, e1)) 275Assert.Equal("A {1}", FormatValue(1, e2)) 293Assert.Equal("0", FormatValue(0, type)) 294Assert.Equal("A {1}", FormatValue(1, type)) 295Assert.Equal("B {2}", FormatValue(2, type)) 296Assert.Equal("A Or B {3}", FormatValue(3, type)) 297Assert.Equal("4", FormatValue(4, type)) 316Assert.Equal("None {0}", FormatValue(0, type)) 317Assert.Equal("A {1}", FormatValue(1, type)) 318Assert.Equal("B {2}", FormatValue(2, type)) 319Assert.Equal("A Or B {3}", FormatValue(3, type)) 320Assert.Equal("4", FormatValue(4, type)) 340Assert.Equal("None {0}", FormatValue(0, type)) 341Assert.Equal("A {1}", FormatValue(1, type)) 342Assert.Equal("B {2}", FormatValue(2, type)) 343Assert.Equal("C {3}", FormatValue(3, type)) 344Assert.Equal("4", FormatValue(4, type)) 363Assert.Equal("None {0}", FormatValue(0, type)) 364Assert.Equal("A {-1}", FormatValue(-1, type)) 365Assert.Equal("B {-2}", FormatValue(-2, type)) 366Assert.Equal("-3", FormatValue(-3, type)) 367Assert.Equal("-4", FormatValue(-4, type)) 396Assert.Equal("0", FormatValue(0, e1)) 397Assert.Equal("A {1}", FormatValue(1, e1)) 398Assert.Equal("C {2}", FormatValue(2, e1)) 399Assert.Equal("A Or C {3}", FormatValue(3, e1)) 401Assert.Equal("0", FormatValue(0, e2)) 402Assert.Equal("A {1}", FormatValue(1, e2)) 403Assert.Equal("C {2}", FormatValue(2, e2)) 404Assert.Equal("A Or C {3}", FormatValue(3, e2)) 440Assert.Equal("&H00000001", FormatValue(1, pointerType, useHexadecimal:=False)) ' In hex, regardless. 441Assert.Equal("&H00000001", FormatValue(1, pointerType, useHexadecimal:=True)) 443Assert.Equal("&HFFFFFFFF", FormatValue(-1, doublePointerType, useHexadecimal:=False)) ' In hex, regardless. 444Assert.Equal("&HFFFFFFFF", FormatValue(-1, doublePointerType, useHexadecimal:=True)) 468Assert.Equal("Nothing", FormatValue(Nothing, nullableConstructedType)) 469Assert.Equal("{ToString() called.}", FormatValue(constructedType.Instantiate(), nullableConstructedType)) 471Assert.Equal("Nothing", FormatValue(Nothing, nullableInt)) 472Assert.Equal("1", FormatValue(1, nullableInt)) 495Assert.Equal("Nothing", FormatValue(Nothing, typeA)) 496Assert.Equal("Nothing", FormatValue(Nothing, typeB)) 497Assert.Equal("Nothing", FormatValue(Nothing, typeC))