public void write_transactional_script_with_a_role()
        {
            var rules = new DdlRules();

            rules.Role = "OCD_DBA";

            var patch = new SchemaPatch(rules);

            var writer = new StringWriter();

            patch.WriteScript(writer, w =>
            {
                w.WriteLine("Hello.");
            });

            writer.ToString().ShouldContain("SET ROLE OCD_DBA;");
            writer.ToString().ShouldContain("RESET ROLE;");
        }
Beispiel #2
0
        public void write_transactional_script_with_no_role()
        {
            var rules = new DdlRules();

            SpecificationExtensions.ShouldBeNull(rules.Role);

            var patch = new SchemaPatch(rules);

            var writer = new StringWriter();

            patch.WriteScript(writer, w =>
            {
                w.WriteLine("Hello.");
            });

            SpecificationExtensions.ShouldNotContain(writer.ToString(), "SET ROLE");
            SpecificationExtensions.ShouldNotContain(writer.ToString(), "RESET ROLE;");
        }