Inheritance: Raven.Client.ContextualListeners.AbstractDocumentConversionListenerContext
        public void Should_use_context()
        {
            using (IDocumentSession session = DocumentStore.OpenSession())
            {
                var doc = new Doc {Id = "Doc", Name = "Name"};
                session.Store(doc);
                session.SaveChanges();
            }

            using (var storeContext = new StoreContext())
            using (var deleteContext = new DeleteContext())
            using (var queryContext = new QueryContext())
            using (var conversionContext = new ConversionContext())
            using (IDocumentSession session = DocumentStore.OpenSession())
            {
                var doc1 = new Doc {Id = "Doc1"};
                session.Store(doc1);
                Doc doc2 =
                    session.Query<Doc>()
                        .Where(d => d.Name == "Name")
                        .Customize(c => c.WaitForNonStaleResults())
                        .Single();
                session.Delete(doc2);
                session.SaveChanges();
                Assert.True(storeContext.AfterStoreCalled);
                Assert.True(storeContext.BeforeStoreCalled);
                Assert.True(deleteContext.BeforeDeleteCalled);
                Assert.True(queryContext.BeforeQueryExecutedCalled);
                Assert.True(conversionContext.DocumentToEntityCalled);
                Assert.True(conversionContext.EntityToDocumentCalled);
            }
        }
        public void Should_use_context()
        {
            using (var context = new ConversionContext())
            {
                using (var session = DocumentStore.OpenSession())
                {
                    var doc = new Doc { Id = "Doc" };
                    session.Store(doc);
                    session.SaveChanges();
                    Assert.True(context.EntityToDocumentCalled);
                }
            }

            using (var context = new ConversionContext())
            {
                using (var session = DocumentStore.OpenSession())
                {
                    session.Load<Doc>("Doc");
                    Assert.True(context.DocumentToEntityCalled);
                }
            }
        }
        public async Task Should_use_context_async()
        {
            using (var context = new ConversionContext())
            {
                using (var session = DocumentStore.OpenAsyncSession())
                {
                    var doc = new Doc {Id = "Doc"};
                    await session.StoreAsync(doc);
                    await session.SaveChangesAsync();
                    Assert.True(context.EntityToDocumentCalled);
                }
            }

            using (var context = new ConversionContext())
            {
                using (var session = DocumentStore.OpenAsyncSession())
                {
                    await session.LoadAsync<Doc>("Doc");
                    Assert.True(context.DocumentToEntityCalled);
                }
            }
        }