protected override void Given() { session = Substitute.For<ISerializationSession>(); var backingStore = Substitute.For<IBackingStore>(); var registry = new Registry(backingStore); registry.RegisterGraph<IsolatedClass>(); registry.RegisterGraph<ComposingClass>(); subject = new JsonSerializer<ComposingClass>((IRegisteredGraph<ComposingClass>)registry.RegisteredGraphs[typeof(ComposingClass)]); isolatedGraph = new IsolatedClass {AProperty = "test property"}; composingGraph = new ComposingClass {AnotherProperty = "another property", Composed = isolatedGraph}; expectedInternalId = new InternalId(Guid.NewGuid()); session.InternalIdOfTrackedGraph(isolatedGraph).Returns(expectedInternalId); }
protected override void When() { actual = subject.Deserialize(serialised, session); }