public void InspectionFormatter_Formats_Class() { var formatter = new InspectionFormatter(new ReferenceTest()); Assert.AreEqual(@"ReferenceTest { Pointer: null }", formatter.ToString()); }
public void InspectionFormatter_Formats_DictionaryEmpty() { var dictionary = new Dictionary <char, string>(); var formatter = new InspectionFormatter(dictionary); Assert.AreEqual("Dictionary<Char, String> {}", formatter.ToString()); }
public void InspectionFormatter_Formats_ExtendedDictionaryEmpty() { var dictionary = new ExtendedDictionaryTest(); var formatter = new InspectionFormatter(dictionary); Assert.AreEqual(@"ExtendedDictionaryTest [Dictionary] {}", formatter.ToString()); }
public void InspectionFormatter_Formats_ClassReference() { var data = new ReferenceTest { Pointer = new ReferenceTest() }; var formatter = new InspectionFormatter(data); Assert.AreEqual(@"ReferenceTest { Pointer: [ReferenceTest] }", formatter.ToString()); }
public void InspectionFormatter_Formats_ClassCircular() { var data = new ReferenceTest(); data.Pointer = data; var formatter = new InspectionFormatter(data); Assert.AreEqual(@"ReferenceTest { Pointer: [Circular] }", formatter.ToString()); }
public void InspectionFormatter_Formats_ExtendedDictionaryPopulated() { var dictionary = new ExtendedDictionaryTest { { 1, 4 }, { 6, 12 } }; var formatter = new InspectionFormatter(dictionary); Assert.AreEqual(@"ExtendedDictionaryTest [Dictionary] { 1 => 4, 6 => 12 }", formatter.ToString()); }
public void InspectionFormatter_Formats_DictionaryPopulated() { var dictionary = new Dictionary <char, string> { { 'a', "An amazing \"flute\"!" }, { 'b', "Boom!" } }; var formatter = new InspectionFormatter(dictionary); Assert.AreEqual(@"Dictionary<Char, String> { 'a' => ""An amazing \""flute\""!"", 'b' => ""Boom!"" }", formatter.ToString()); }
public void InspectionFormatter_Formats_Struct() { var data = new TestStruct { Char = 'a', Code = 97 }; var formatter = new InspectionFormatter(data); Assert.AreEqual(@"TestStruct { Char: 'a', Code: 0x61 }", formatter.ToString()); }
public void InspectionFormatter_Formats_NoDepthStruct() { var data = new InnerTestStruct { Name = "LowerCaseCharacter", Identifier = IdentifierType.LowerCase, Data = new TestStruct { Char = 'a', Code = 97 } }; var formatter = new InspectionFormatter(data); Assert.AreEqual(@"InnerTestStruct { Identifier: IdentifierType.LowerCase, Name: ""LowerCaseCharacter"", Data: [TestStruct] }", formatter.ToString()); }
public void InspectionFormatter_Formats_Double() { var formatter = new InspectionFormatter(0.123456D); Assert.AreEqual("0.123456D", formatter.ToString()); }
public void InspectionFormatter_Formats_Decimal() { var formatter = new InspectionFormatter(0.1234567891234M); Assert.AreEqual("0.1234567891234M", formatter.ToString()); }
public void InspectionFormatter_Formats_BoolFalse() { var formatter = new InspectionFormatter(false); Assert.AreEqual("false", formatter.ToString()); }
public void InspectionFormatter_Formats_SymbolChar() { var formatter = new InspectionFormatter('$'); Assert.AreEqual("'$'", formatter.ToString()); }
public void InspectionFormatter_Formats_Type() { var formatter = new InspectionFormatter('a'.GetType()); Assert.AreEqual("System.Char", formatter.ToString()); }
public void InspectionFormatter_Formats_ControlChar() { var formatter = new InspectionFormatter('\u0000'); Assert.AreEqual("'\\u0000'", formatter.ToString()); }
public void InspectionFormatter_Formats_SignedBytePadded() { var formatter = new InspectionFormatter((sbyte)0x04); Assert.AreEqual("0x04", formatter.ToString()); }
public void InspectionFormatter_Formats_BasicString() { var formatter = new InspectionFormatter("Hello world"); Assert.AreEqual(@"""Hello world""", formatter.ToString()); }
public void InspectionFormatter_Formats_LetterChar() { var formatter = new InspectionFormatter('a'); Assert.AreEqual("'a'", formatter.ToString()); }
public void InspectionFormatter_Formats_DateTime() { var formatter = new InspectionFormatter(DateTime.Parse("2020-04-06T16:03:45.040Z")); Assert.AreEqual("2020-04-06T16:03:45.040Z", formatter.ToString()); }
public void InspectionFormatter_Formats_ArrayOfChars() { var formatter = new InspectionFormatter(new[] { 'a', 'ã‚¢', '$', '\u0000' }); Assert.AreEqual("Char[4] { 'a', 'ã‚¢', '$', '\\u0000' }", formatter.ToString()); }
public void InspectionFormatter_Formats_ArrayOfInts() { var formatter = new InspectionFormatter(new[] { 4, 6, 3, 7 }); Assert.AreEqual("Int32[4] { 4, 6, 3, 7 }", formatter.ToString()); }
public void InspectionFormatter_Formats_DelegateSingleArgument() { var formatter = new InspectionFormatter(new DelegateSingleArgument(name => name)); Assert.AreEqual("DelegateSingleArgument(String name) => String", formatter.ToString()); }
public void InspectionFormatter_Formats_DelegateMultipleArguments() { var formatter = new InspectionFormatter(new DelegateMultipleArguments((a, b) => a + b)); Assert.AreEqual("DelegateMultipleArguments(Int32 a, Int32 b) => Int32", formatter.ToString()); }
public void InspectionFormatter_Formats_Float() { var formatter = new InspectionFormatter(0.2f); Assert.AreEqual("0.2F", formatter.ToString()); }
public void InspectionFormatter_Formats_UnicodePart() { var formatter = new InspectionFormatter("😊"[0]); Assert.AreEqual("'\\uD83D'", formatter.ToString()); }
public void InspectionFormatter_Formats_TimeSpan() { var formatter = new InspectionFormatter(TimeSpan.FromMinutes(5)); Assert.AreEqual("00:05:00", formatter.ToString()); }
public void InspectionFormatter_Formats_QuotedString() { var formatter = new InspectionFormatter(@"Hello ""world"""); Assert.AreEqual(@"""Hello \""world\""""", formatter.ToString()); }
public void InspectionFormatter_Formats_EmptyStruct() { var formatter = new InspectionFormatter(new TestEmptyStruct()); Assert.AreEqual("TestEmptyStruct {}", formatter.ToString()); }
public void InspectionFormatter_Formats_Byte() { var formatter = new InspectionFormatter((byte)0x14); Assert.AreEqual("0x14U", formatter.ToString()); }
public void InspectionFormatter_Formats_UnsignedLong() { var formatter = new InspectionFormatter(242043489611808769UL); Assert.AreEqual("242043489611808769UL", formatter.ToString()); }