public void MethodWithContext() { var context = new MethodTestContext { Value = 3 }; var x = new MethodTestWithContext { InnerValue = 3, CachedValue = 3 }; _setupSerializer = s => (s as IBinary).SetCustomHookContext(context); _setupSerializerGraph = s => (s as IBinary).SetCustomHookContext(context); RoundTrip(x); }
private void AfterDeserializationMethod(MethodTestContext context) { CachedValue = (context?.Value) ?? 255; }