diff --git a/.gitignore b/.gitignore index 39094a9..53c052b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ **/.vs **/bin **/obj -source/SpecGurka/appsettings.json source/GenGurka/App.config -**/TestResults \ No newline at end of file +**/TestResults +source/SyncGurka/appsettings.json diff --git a/VizGurka.sln b/VizGurka.sln index be4f0e5..6117665 100644 --- a/VizGurka.sln +++ b/VizGurka.sln @@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.10.34928.147 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VizGurka", "source\VizGurka\VizGurka.csproj", "{9B0404AE-B976-434F-BF1E-5667597021E0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VizGurka", "source\VizGurka\VizGurka.csproj", "{9B0404AE-B976-434F-BF1E-5667597021E0}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GurkaSpec", "source\GurkaSpec\GurkaSpec.csproj", "{5347A6E1-0AB2-473C-A339-C6BAE144015B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -15,6 +17,10 @@ Global {9B0404AE-B976-434F-BF1E-5667597021E0}.Debug|Any CPU.Build.0 = Debug|Any CPU {9B0404AE-B976-434F-BF1E-5667597021E0}.Release|Any CPU.ActiveCfg = Release|Any CPU {9B0404AE-B976-434F-BF1E-5667597021E0}.Release|Any CPU.Build.0 = Release|Any CPU + {5347A6E1-0AB2-473C-A339-C6BAE144015B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5347A6E1-0AB2-473C-A339-C6BAE144015B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5347A6E1-0AB2-473C-A339-C6BAE144015B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5347A6E1-0AB2-473C-A339-C6BAE144015B}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/source/GenGurka/GenGurka.csproj b/source/GenGurka/GenGurka.csproj index 804ed31..107731f 100644 --- a/source/GenGurka/GenGurka.csproj +++ b/source/GenGurka/GenGurka.csproj @@ -18,7 +18,7 @@ - + diff --git a/source/GenGurka/Program.cs b/source/GenGurka/Program.cs index 7320e4b..1e9b69e 100644 --- a/source/GenGurka/Program.cs +++ b/source/GenGurka/Program.cs @@ -78,20 +78,7 @@ // exc time - -XmlSerializer xsSubmit = new XmlSerializer(typeof(Testrun)); -var xml = ""; - -using (var sww = new StringWriter()) -{ - using (XmlWriter writer = XmlWriter.Create(sww)) - { - xsSubmit.Serialize(writer, gurka); - xml = sww.ToString(); // Your XML - } -} - -System.IO.File.WriteAllText($"{ConfigurationManager.AppSettings["outputpath"]}testrun_{DateTime.UtcNow.ToString("s").Replace(':','_')}.gurka", xml); +Gurka.WriteGurkaFile(ConfigurationManager.AppSettings["outputpath"], gurka); Console.WriteLine("heelo"); diff --git a/source/GurkaSpec/Background.cs b/source/GurkaSpec/Background.cs new file mode 100644 index 0000000..20bd706 --- /dev/null +++ b/source/GurkaSpec/Background.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SpecGurka.GurkaSpec +{ + public class Background + { + public string Name { get; set; } + } +} diff --git a/source/GurkaSpec/Gurka.cs b/source/GurkaSpec/Gurka.cs new file mode 100644 index 0000000..5d91c47 --- /dev/null +++ b/source/GurkaSpec/Gurka.cs @@ -0,0 +1,37 @@ +using System.Xml.Serialization; +using System.Xml; + +namespace SpecGurka.GurkaSpec +{ + public class Gurka + { + public static Testrun ReadGurkaFile(string path) + { + var xml = System.IO.File.ReadAllText(path); + XmlSerializer serializer = new XmlSerializer(typeof(Testrun)); + Testrun result; + using (TextReader reader = new StringReader(xml)) + { + result = (Testrun)serializer.Deserialize(reader); + } + return result; + } + + public static void WriteGurkaFile(string path, Testrun testrun) + { + XmlSerializer xsSubmit = new XmlSerializer(typeof(Testrun)); + var xml = ""; + + using (var sww = new StringWriter()) + { + using (XmlWriter writer = XmlWriter.Create(sww)) + { + xsSubmit.Serialize(writer, testrun); + xml = sww.ToString(); // Your XML + } + } + + System.IO.File.WriteAllText($"{path}testrun_{DateTime.UtcNow.ToString("s").Replace(':', '_')}.gurka", xml); + } + } +} diff --git a/source/GurkaSpec/Rule.cs b/source/GurkaSpec/Rule.cs new file mode 100644 index 0000000..f4b8463 --- /dev/null +++ b/source/GurkaSpec/Rule.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace SpecGurka.GurkaSpec +{ + public class Rule + { + public string Name { get; set; } + } +} diff --git a/source/GurkaSpec/Scenario.cs b/source/GurkaSpec/Scenario.cs index 679897d..3e7fd58 100644 --- a/source/GurkaSpec/Scenario.cs +++ b/source/GurkaSpec/Scenario.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; +using System.Text.RegularExpressions; using System.Xml.Serialization; namespace SpecGurka.GurkaSpec diff --git a/source/VizGurka/VizGurka.csproj b/source/VizGurka/VizGurka.csproj index 1b28a01..6e65ce4 100644 --- a/source/VizGurka/VizGurka.csproj +++ b/source/VizGurka/VizGurka.csproj @@ -6,4 +6,8 @@ enable + + + +