public void NullContext() { var x = new StaticTestWithContext { InnerValue = 3, CachedValue = 255 }; RoundTrip(x); }
public void StaticMethodWithContext() { var context = new StaticTestContext { Value = 3 }; var x = new StaticTestWithContext { InnerValue = 3, CachedValue = 3 }; _setupSerializer = s => (s as IBinary).SetCustomHookContext(context); _setupSerializerGraph = s => (s as IBinary).SetCustomHookContext(context); RoundTrip(x); }
private static void AfterDeserializationMethod(StaticTestWithContext o, StaticTestContext context) { o.CachedValue = (context?.Value) ?? 255; }