public void SetUp()
 {
     using (DatabaseContextFactory.Create())
     {
         DatabaseGateway.ExecuteUsing(RawQuery.Create("delete from SubscriberMessageType"));
     }
 }
 public void ClearSubscriptions()
 {
     using (DatabaseContextFactory.Create(ProviderName, ConnectionString))
     {
         DatabaseGateway.ExecuteUsing(RawQuery.Create("delete from SubscriberMessageType"));
     }
 }
Exemple #3
0
 protected void EmptyDataStore()
 {
     using (CreateDatabaseContext())
     {
         DatabaseGateway.ExecuteUsing(RawQuery.Create("delete from EventStore"));
         DatabaseGateway.ExecuteUsing(RawQuery.Create("delete from KeyStore"));
         DatabaseGateway.ExecuteUsing(RawQuery.Create("delete from SnapshotStore"));
         DatabaseGateway.ExecuteUsing(RawQuery.Create("delete from TypeStore"));
         DatabaseGateway.ExecuteUsing(RawQuery.Create("delete from ProjectionPosition"));
     }
 }
Exemple #4
0
 protected void ClearDataStore()
 {
     using (DatabaseContextFactory.Create(EventStoreConnectionStringName))
     {
         DatabaseGateway.ExecuteUsing(RawQuery.Create("delete from EventStore where Id = @Id").AddParameterValue(Columns.Id, RecallFixture.OrderId));
         DatabaseGateway.ExecuteUsing(RawQuery.Create("delete from EventStore where Id = @Id").AddParameterValue(Columns.Id, RecallFixture.OrderProcessId));
         DatabaseGateway.ExecuteUsing(RawQuery.Create("delete from KeyStore where Id = @Id").AddParameterValue(Columns.Id, RecallFixture.OrderId));
         DatabaseGateway.ExecuteUsing(RawQuery.Create("delete from KeyStore where Id = @Id").AddParameterValue(Columns.Id, RecallFixture.OrderProcessId));
         DatabaseGateway.ExecuteUsing(RawQuery.Create("delete from SnapshotStore where Id = @Id").AddParameterValue(Columns.Id, RecallFixture.OrderId));
         DatabaseGateway.ExecuteUsing(RawQuery.Create("delete from SnapshotStore where Id = @Id").AddParameterValue(Columns.Id, RecallFixture.OrderProcessId));
     }
 }
        public void Should_be_able_to_execute_a_query()
        {
            var query   = new Mock <IQuery>();
            var command = CommandMock();

            command.Setup(m => m.ExecuteNonQuery()).Returns(1);

            var gateway = new DatabaseGateway();

            using (GetDatabaseContext(command))
            {
                var result = gateway.ExecuteUsing(query.Object);

                Assert.IsNotNull(result);
                Assert.AreEqual(1, result);
            }
        }