protected override void Given() { var registry = new Registry(null); var registeredGraph = new RegisteredGraph<IsolatedClass>(registry); subject = new JsonSerializer<IsolatedClass>(registeredGraph); graph = new IsolatedClass {AProperty = "test property"}; session = Substitute.For<ISerializationSession>(); }
public void it_should_find_a_registered_index_by_the_index_type() { var registry = new Registry(null); var registeredIndexer = new RegisteredIndexer<DummyPersistentObject, int>(new DummyIndex(), registry); var sut = new RegisteredGraph<DummyPersistentObject>(registry); registry.RegisteredIndexers.Add(registeredIndexer); sut.GetRegisteredIndexerFor(new DummyIndex()).ShouldEqual(registeredIndexer); }
protected override void WithContext() { base.WithContext(); CloudStorageAccount.DevelopmentStorageAccount.CreateCloudTableClient().DeleteTableIfExist("idxStashAzureSpecificationsSupportStringIndex"); CloudStorageAccount.DevelopmentStorageAccount.CreateCloudTableClient().DeleteTableIfExist("rdxStashAzureSpecificationsSupportStringIndex"); RegisteredGraph = new RegisteredGraph<ClassWithTwoAncestors>(Registry); RegisteredGraph.TransformSerializer = new JsonSerializer<ClassWithTwoAncestors>(RegisteredGraph); RegisteredIndexer = new RegisteredIndexer<ClassWithTwoAncestors, string>(new StringIndex(), Registry); Registry.RegisteredIndexers.Add(RegisteredIndexer); Subject.EnsureIndex(RegisteredIndexer); }