Beispiel #1
0
        public void Execute_GroupReduce_FileGenerated()
        {
            var generator = new TestSuiteGenerator();
            generator.Load(DefinitionFilename);
            generator.Execute();

            Assert.That(File.Exists(TargetFilename));
        }
        public void Load_FileWithEuro_EuroCorrectlyRead()
        {
            var filename = DiskOnFile.CreatePhysicalFile("Simple.genbil", "NBi.Testing.Integration.GenbiL.Resources.Simple.genbil");

            var generator = new TestSuiteGenerator();
            generator.Load(filename);
            Assert.That(generator.Text, Is.StringContaining("€"));
        }
Beispiel #3
0
        public void Run_SimpleTestSuiteBuild_CsvGenerated()
        {
            var generator = new TestSuiteGenerator();
            generator.Load(DefinitionFilename);
            generator.Execute();

            Assert.That(File.Exists(CsvFilename));
        }
Beispiel #4
0
        public void Run_CaseCrossTestSuiteBuild_FileGenerated()
        {
            var generator = new TestSuiteGenerator();
            generator.Load(DefinitionFilename);
            generator.Execute();

            Assert.That(File.Exists(TargetFilename));
        }
 public void ExecuteQuiet(string filename)
 {
     try
     {
         var generator = new TestSuiteGenerator();
         generator.Load(filename);
         generator.Execute();
     }
     catch
     {
         return;
     }
 }
        public void Execute_MatchPattern_NumberFormatSerialized()
        {
            var generator = new TestSuiteGenerator();
            generator.Load(DefinitionFilename);
            generator.Execute();

            if (!File.Exists(TargetFilename))
                Assert.Inconclusive("Test Suite not generated!");

            var content = File.ReadAllText(TargetFilename);
            Assert.That(content, Is.StringContaining("<matchPattern"));
            Assert.That(content, Is.StringContaining("<numeric-format"));
            Assert.That(content, Is.StringContaining("decimal-digits=\"3\""));
        }
Beispiel #7
0
        public void Execute_GroupReduce_CorrectRendering()
        {
            var generator = new TestSuiteGenerator();
            generator.Load(DefinitionFilename);
            generator.Execute();

            if (!File.Exists(TargetFilename))
                Assert.Inconclusive("Test Suite not generated!");

            var content = File.ReadAllText(TargetFilename);
            Assert.That(content.Count(c => c=='\r'), Is.LessThan(25));
            content = content.Replace("\t", "").Replace("\r", "").Replace("\n", "").Replace(" ", "");
            Assert.That(content, Is.StringContaining("<contain><item>first-dimension</item><item>second-dimension</item><item>exclude-dimension</item></contain>"));
            Assert.That(content, Is.StringContaining("...\"><category>x</category><category>y</category><system-under-test>"));
            Assert.That(content, Is.StringContaining("<structure><dimensionsperspective=\"first-perspective\"/></structure>"));
        }
Beispiel #8
0
        public void Run_SimpleTestSuiteBuild_FileIsCorrect()
        {
            var generator = new TestSuiteGenerator();
            generator.Load(DefinitionFilename);
            generator.Execute();

            if (!File.Exists(TargetFilename))
                Assert.Inconclusive("Test Suite not generated!");

            var content = File.ReadAllText(TargetFilename);
            Assert.That(content, Is.StringContaining("<dimension "));
            Assert.That(content, Is.StringContaining("caption=\"first-dimension\""));
            Assert.That(content, Is.StringContaining("caption=\"second-dimension\""));
            Assert.That(content, Is.Not.StringContaining("caption=\"exclude-dimension\""));
            Assert.That(content, Is.StringContaining("perspective=\"first-perspective\""));
            Assert.That(content, Is.StringContaining("exist"));

            Assert.That(content, Is.StringContaining("<dimensions "));
            Assert.That(content, Is.StringContaining("<subsetOf"));

            Assert.That(content, Is.StringContaining("<default"));
            Assert.That(content, Is.StringContaining("apply-to=\"assert\""));
            Assert.That(content, Is.StringContaining("<connectionString>youyou-default-assert</connectionString>"));

            Assert.That(content, Is.StringContaining("<default"));
            Assert.That(content, Is.StringContaining("apply-to=\"system-under-test\""));
            Assert.That(content, Is.StringContaining("<connectionString>youyou-default-sut</connectionString>"));
            Assert.That(content, Is.Not.StringContaining("name=\"System-Under-Test\""));
            Assert.That(content, Is.Not.StringContaining("<report />"));

            Assert.That(content, Is.StringContaining("<reference"));
            Assert.That(content, Is.StringContaining("name=\"noway\""));
            Assert.That(content, Is.StringContaining("<connectionString>youyou-reference-noway</connectionString>"));

            Assert.That(content, Is.StringContaining("<hierarchy "));
            Assert.That(content, Is.StringContaining("caption=\"first-hierarchy\""));
            Assert.That(content, Is.StringContaining("caption=\"second-hierarchy\""));
            Assert.That(content, Is.Not.StringContaining("caption=\"third-hierarchy\""));
            Assert.That(content, Is.StringContaining("dimension=\"first-dimension\""));

            Assert.That(content, Is.StringContaining("<hierarchies "));
            Assert.That(content, Is.StringContaining("<subsetOf"));
            Assert.That(content, Is.Not.StringContaining("<item>fourth-hierarchy</item>"));

            Assert.That(content, Is.StringContaining("<parallelize-queries>false</parallelize-queries>"));
        }
        public void ExecuteVisual(string filename)
        {
            var generator = new TestSuiteGenerator();
            generator.Load(filename);
            try
            {
                window.Show();
                generator.ActionInfoEvent += ActionInfo;
                generator.Execute();
                generator.ActionInfoEvent -= ActionInfo;
            }
            catch (Exception ex)
            {
                ShowException(String.Format("Exception generated during execution of the macro.\r\n\r\n{0}", ex.Message));
                return;
            }

            ShowInform(String.Format("Macro has been executed succesfully."));
        }
Beispiel #10
0
 protected virtual void ActionInfo(object sender, TestSuiteGenerator.ActionInfoEventArgs e)
 {
     window.AppendText(e.Message);
 }