Ejemplo n.º 1
0
 public void SetUp()
 {
     _store = new EmbeddableDocumentStore
     {
         RunInMemory = true,
         DataDirectory = Path.GetTempPath()
     };
     _store.Initialize();
     _session = _store.OpenAsyncSession();
 }
Ejemplo n.º 2
0
 public void TestInitialize()
 {
     // Arrange
     _documentStore = new EmbeddableDocumentStore
     {
         ConnectionStringName = "RavenDB"
     };
     _documentStore.Initialize();
     _session = _documentStore.OpenAsyncSession();
     _controller = new MoviesController(_session);
 }
Ejemplo n.º 3
0
 public async void Show()
 {
     using (var store = new EmbeddableDocumentStore
     {
         RunInMemory = true,
         DataDirectory = Path.GetTempPath()
     })
     {
         store.Initialize();
         using (var session = store.OpenAsyncSession())
         {
             var portfolioId = Guid.NewGuid();
             await new ConnectedProjector<IAsyncDocumentSession>(Resolve.WhenEqualToHandlerMessageType(Projection.Handlers)).
                 ProjectAsync(session, new object[]
                 {
                     new PortfolioAdded {Id = portfolioId, Name = "My portfolio"},
                     new PortfolioRenamed {Id = portfolioId, Name = "Your portfolio"},
                     new PortfolioRemoved {Id = portfolioId}
                 });
         }
     }
 }
Ejemplo n.º 4
0
 public void SetUp()
 {
     _store = new EmbeddableDocumentStore
     {
         RunInMemory = true,
         DataDirectory = Path.GetTempPath()
     };
     _store.Initialize();
     _session = _store.OpenAsyncSession();
     _calls = new List<RavenProjectionHandlerCall>();
     var handler1 = new RavenProjectionHandler(
         typeof(MatchMessage1),
         (connection, msg, token) =>
         {
             _calls.Add(new RavenProjectionHandlerCall(connection, msg, token));
             return Task.FromResult(false);
         });
     var handler2 = new RavenProjectionHandler(
         typeof(MatchMessage2),
         (connection, msg, token) =>
         {
             _calls.Add(new RavenProjectionHandlerCall(connection, msg, token));
             return Task.FromResult(false);
         });
     var handler3 = new RavenProjectionHandler(
         typeof(MatchMessage1),
         (connection, msg, token) =>
         {
             _calls.Add(new RavenProjectionHandlerCall(connection, msg, token));
             return Task.FromResult(false);
         });
     var handler4 = new RavenProjectionHandler(
         typeof(MatchMessage2),
         (connection, msg, token) =>
         {
             _calls.Add(new RavenProjectionHandlerCall(connection, msg, token));
             return Task.FromResult(false);
         });
     _sut = SutFactory(new[] { handler1, handler2, handler3, handler4 });
 }