public void retrieve_drop_script()
        {
            var sql = SqlServerEnvelopeStorageAdmin.ToDropScript("foo");

            sql.ShouldContain("drop table foo.jasper_outgoing_envelopes");
            sql.ShouldContain("drop table foo.jasper_incoming_envelopes");
        }
        public void retrieve_creation_script()
        {
            var sql = SqlServerEnvelopeStorageAdmin.ToCreationScript("foo");

            sql.ShouldContain("create table foo.jasper_outgoing_envelopes");
            sql.ShouldContain("create table foo.jasper_incoming_envelopes");
        }
        public void smoke_test_clear_all()
        {
            var loader = new SqlServerEnvelopeStorageAdmin(new SqlServerSettings {
                ConnectionString = Servers.SqlServerConnectionString
            });

            loader.As <IEnvelopeStorageAdmin>().ClearAllPersistedEnvelopes();
        }
        public void recreate_all_tables()
        {
            var loader = new SqlServerEnvelopeStorageAdmin(new SqlServerSettings {
                ConnectionString = Servers.SqlServerConnectionString
            });

            loader.RecreateAll();
        }
        public void recreate_all_tables_in_a_different_schema()
        {
            var loader = new SqlServerEnvelopeStorageAdmin(new SqlServerSettings {
                ConnectionString = Servers.SqlServerConnectionString, SchemaName = "sender"
            });

            loader.RecreateAll();
        }
        public void generate_sql()
        {
            var loader = new SqlServerEnvelopeStorageAdmin(new SqlServerSettings {
                ConnectionString = Servers.SqlServerConnectionString
            });

            _output.WriteLine(loader.As <IEnvelopeStorageAdmin>().CreateSql());
        }
        protected SqlServerContext()
        {
            var loader = new SqlServerEnvelopeStorageAdmin(new SqlServerSettings {
                ConnectionString = Servers.SqlServerConnectionString
            });

            loader.RecreateAll();
        }
        public void drop_then_create_different_schema()
        {
            var loader = new SqlServerEnvelopeStorageAdmin(new SqlServerSettings {
                ConnectionString = Servers.SqlServerConnectionString, SchemaName = "receiver"
            });

            loader.DropAll();

            loader.CreateAll();
        }
        public void drop_then_create()
        {
            var loader = new SqlServerEnvelopeStorageAdmin(new SqlServerSettings {
                ConnectionString = Servers.SqlServerConnectionString
            });

            loader.DropAll();

            loader.CreateAll();
        }
        public override void SetUp()
        {
            var admin = new SqlServerEnvelopeStorageAdmin(new SqlServerSettings {
                ConnectionString = Servers.SqlServerConnectionString
            });

            admin.RecreateAll();

            var registry = new ScheduledMessageApp();

            theReceiver = registry.Receiver;

            var logger = new StorytellerAspNetCoreLogger();

            Context.Reporting.Log(logger);



            theHost = JasperHost
                      .CreateDefaultBuilder()
                      .ConfigureLogging(x => x.AddProvider(logger))
                      .UseJasper(registry)
                      .StartJasper();
        }