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("<settings>")); Assert.That(content, Is.StringContaining("<default ")); Assert.That(content, Is.StringContaining("apply-to=\"system-under-test\"")); Assert.That(content, Is.StringContaining("<connection-string>myDefaultConnectionString</connection-string>")); Assert.That(content, Is.StringContaining("<reference")); Assert.That(content, Is.StringContaining("name=\"olap\"")); Assert.That(content, Is.StringContaining("<connection-string>myReferenceConnectionString</connection-string>")); Assert.That(content, Is.StringContaining("<regex")); Assert.That(content, Is.StringContaining("[AZ-az]")); Assert.That(content, Is.StringContaining("<csv-profile")); Assert.That(content, Is.StringContaining("field-separator=\"Tab\"")); Assert.That(content, Is.Not.StringContaining("<MissingCell")); Assert.That(content, Is.Not.StringContaining("<EmptyCell")); }
public void Run_CaseCrossTestSuiteBuild_FileGenerated() { var generator = new TestSuiteGenerator(); generator.Load(DefinitionFilename); generator.Execute(); Assert.That(File.Exists(TargetFilename)); }
public void Execute_Consumables_FileGenerated() { var generator = new TestSuiteGenerator(); generator.Load(DefinitionFilename); generator.Execute(); Assert.That(File.Exists(TargetFilename)); }
public void Run_SimpleTestSuiteBuild_CsvGenerated() { var generator = new TestSuiteGenerator(); generator.Load(DefinitionFilename); generator.Execute(); Assert.That(File.Exists(CsvFilename)); }
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, Does.Contain("€")); }
public void ExecuteQuiet(string filename) { try { var generator = new TestSuiteGenerator(); generator.Load(filename); generator.Execute(); } catch { return; } }
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, Does.Contain("<dimension ")); Assert.That(content, Does.Contain("caption=\"first-dimension\"")); Assert.That(content, Does.Contain("caption=\"second-dimension\"")); Assert.That(content, Is.Not.StringContaining("caption=\"exclude-dimension\"")); Assert.That(content, Does.Contain("perspective=\"first-perspective\"")); Assert.That(content, Does.Contain("exist")); Assert.That(content, Does.Contain("<dimensions ")); Assert.That(content, Does.Contain("<contained-in")); Assert.That(content, Does.Contain("<default")); Assert.That(content, Does.Contain("apply-to=\"assert\"")); Assert.That(content, Does.Contain("<connection-string>youyou-default-assert</connection-string>")); Assert.That(content, Does.Contain("<default")); Assert.That(content, Does.Contain("apply-to=\"system-under-test\"")); Assert.That(content, Does.Contain("<connection-string>youyou-default-sut</connection-string>")); Assert.That(content, Is.Not.StringContaining("name=\"System-Under-Test\"")); Assert.That(content, Is.Not.StringContaining("<report />")); Assert.That(content, Does.Contain("<reference")); Assert.That(content, Does.Contain("name=\"noway\"")); Assert.That(content, Does.Contain("<connection-string>youyou-reference-noway</connection-string>")); Assert.That(content, Does.Contain("<hierarchy ")); Assert.That(content, Does.Contain("caption=\"first-hierarchy\"")); Assert.That(content, Does.Contain("caption=\"second-hierarchy\"")); Assert.That(content, Is.Not.StringContaining("caption=\"third-hierarchy\"")); Assert.That(content, Does.Contain("dimension=\"first-dimension\"")); Assert.That(content, Does.Contain("<hierarchies ")); Assert.That(content, Does.Contain("<contained-in")); Assert.That(content, Is.Not.StringContaining("<item>fourth-hierarchy</item>")); Assert.That(content, Does.Contain("<parallelize-queries>false</parallelize-queries>")); }
public void Execute_Group_FileGeneratedWithoutListString() { var generator = new TestSuiteGenerator(); generator.Load(DefinitionFilename); generator.Execute(); Assert.That(File.Exists(TargetFilename)); var text = File.ReadAllText(TargetFilename); Assert.That(text, Is.Not.StringContaining("System.Collections.Generic.List`1[System.String]")); Assert.That(text, Does.Contain("<category>91675</category>")); Assert.That(text, Does.Contain("<category>75755</category>")); }
public void Execute_SplitDistinct_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); }
public void Execute_Consumables_Set() { 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("<category>It works!</category>")); }
public void Execute_GlobalVariables_Auto() { 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($"<category>{DateTime.Now.Date.ToShortDateString()}</category>")); }
public void Execute_MultipleTemplates_CorrectOrderOfTests() { 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.Replace(Environment.NewLine, ""), Is.StringMatching("^.*<more.*<less.*<more.*<less.*$")); }
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, Does.Contain("<matchPattern")); Assert.That(content, Does.Contain("<numeric-format")); Assert.That(content, Does.Contain("decimal-digits=\"3\"")); }
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(26)); 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>")); }
public void Execute(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.")); }
public void Run_SimpleTestSuiteBuild_FileIsCorrect() { var generator = new TestSuiteGenerator(); generator.Load(DefintionFilename); 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.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("<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>")); }
public void Execute_GenbiL_EqualToIsThere() { var generator = new TestSuiteGenerator(); generator.Load(DefinitionFilename); generator.Execute(); if (!File.Exists(TargetFilename)) { Assert.Inconclusive("Test Suite not generated!"); } var content = File.ReadAllText(TargetFilename); Console.WriteLine(content); Assert.That(content, Does.Contain("<query connection-string=\"@tst\" timeout-milliSeconds=\"10000\">")); Assert.That(content, Does.Contain("<query connection-string=\"@tst\" timeout-milliSeconds=\"5000\">")); Assert.That(content, Does.Contain("<equal-to>")); Assert.That(content, Does.Contain("<if-unavailable>")); Assert.That(content, Does.Contain("TC02")); }
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, Does.Contain("<variables>")); Assert.That(content, Does.Contain("<variable ")); Assert.That(content, Does.Contain("name=\"var1\"")); Assert.That(content, Does.Contain("DateTime.Now")); }
public void Execute_Dictionary_Set() { 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, Does.Contain("<predicate operand=\"[foo]\">")); Assert.That(content, Does.Contain("<equal>0</equal>")); Assert.That(content, Does.Contain("<predicate operand=\"[bar]\">")); Assert.That(content, Does.Contain("<equal>None</equal>")); Assert.That(content, Does.Contain("<equal>1</equal>")); Assert.That(content, Does.Contain("<equal>Some</equal>")); Assert.That(content, Does.Contain("<predicate operand=\"[wax]\">")); Assert.That(content, Does.Contain("<equal>false</equal>")); }