public void キャッシュ付きのリフレクションによるシリアライズ() { var serializer = new StringSerializerWithCachedReflection(); var stopwatch = new Stopwatch(); stopwatch.Start(); for (var i = 0; i < Setting.PerformanceTestTrialCount; i++) { serializer.Serialize(Helper.TestObject); } stopwatch.Stop(); Helper.PrintResult(stopwatch); }
public void キャッシュ付きリフレクションで正しくシリアライズできる() { var serializableObject = new SimpleSerializableObject() { Int1 = 1, Int2 = 2, Int3 = 3, String1 = "abc", String2 = "def", String3 = "ghi", }; var serializer = new StringSerializerWithCachedReflection(); Assert.AreEqual( "Int1\t1\n" + "Int2\t2\n" + "Int3\t3\n" + "String1\tabc\n" + "String2\tdef\n" + "String3\tghi\n", serializer.Serialize(serializableObject)); }