public void Serialize_CustomWithParameters_Correct() { var root = new ConditionXml() { Predicates = new List <DecorationConditionXml>() { new CustomConditionXml() { AssemblyPath = "myAssembly.dll", TypeName = "myType", Parameters = new List <CustomConditionParameterXml>() { new CustomConditionParameterXml() { Name = "firstParam", StringValue = "myValue" } } } } }; var manager = new XmlManager(); var xml = manager.XmlSerializeFrom(root); Console.WriteLine(xml); Assert.That(xml, Does.Contain("<parameter name=\"firstParam\">myValue</parameter>")); }
public TestXml() : base() { Constraints = new List <AbstractConstraintXml>(); Systems = new List <AbstractSystemUnderTestXml>(); Condition = new ConditionXml(); GroupNames = new List <string>(); }
public TestXml() : base() { InstanceSettling = InstanceSettlingXml.Unique; Constraints = new List <AbstractConstraintXml>(); Systems = new List <AbstractSystemUnderTestXml>(); Condition = new ConditionXml(); GroupNames = new List <string>(); }
public TestXml() : base() { Constraints = new List<AbstractConstraintXml>(); Systems = new List<AbstractSystemUnderTestXml>(); Condition = new ConditionXml(); GroupNames = new List<string>(); }
public TestXml() { Constraints = new List<AbstractConstraintXml>(); Systems = new List<AbstractSystemUnderTestXml>(); Categories = new List<string>(); Setup = new SetupXml(); Cleanup = new CleanupXml(); Condition = new ConditionXml(); GroupNames = new List<string>(); }
public TestXml() { Constraints = new List <AbstractConstraintXml>(); Systems = new List <AbstractSystemUnderTestXml>(); Categories = new List <string>(); Setup = new SetupXml(); Cleanup = new CleanupXml(); Condition = new ConditionXml(); GroupNames = new List <string>(); }
private void ExecuteChecks(ConditionXml check) { foreach (var predicate in check.Predicates) { var impl = new DecorationFactory().Get(predicate); var isVerified = impl.Validate(); if (!isVerified) { Assert.Ignore("This test has been ignored because following check wasn't successful: {0}", impl.Message); } } }
private void ExecuteChecks(ConditionXml check) { foreach (var predicate in check.Predicates) { var impl = new DecorationFactory().Get(predicate); var isVerified = impl.Validate(); if (!isVerified) { Trace.WriteLineIf(Extensibility.NBiTraceSwitch.TraceInfo, $"Test ignored. At least one condition was not validated: '{impl.Message}'"); Assert.Ignore($"This test has been ignored because following check wasn't successful: {impl.Message}"); } } }
private void ValidateConditions(ConditionXml condition, IDictionary <string, ITestVariable> allVariables) { foreach (var predicate in condition.Predicates) { var helper = new ConditionHelper(serviceLocator, allVariables); var args = helper.Execute(predicate); var impl = new DecorationFactory().Instantiate(args); var isVerified = impl.Validate(); if (!isVerified) { Trace.WriteLineIf(NBiTraceSwitch.TraceInfo, $"Test ignored. At least one condition was not validated: '{impl.Message}'"); Assert.Ignore($"This test has been ignored because following check wasn't successful: {impl.Message}"); } } }
public TestXml(TestStandaloneXml standalone) { Categories = standalone.Categories; Cleanup = standalone.Cleanup; Condition = standalone.Condition; Constraints = standalone.Constraints; DescriptionElement = standalone.DescriptionElement; Drafts = standalone.Drafts; Edition = standalone.Edition; IgnoreElement = standalone.IgnoreElement; InstanceSettling = standalone.InstanceSettling; Name = standalone.Name; Setup = standalone.Setup; Systems = standalone.Systems; Traits = standalone.Traits; UniqueIdentifier = standalone.UniqueIdentifier; }
public void Serialize_Custom_Correct() { var root = new ConditionXml() { Predicates = new List <DecorationConditionXml>() { new CustomConditionXml() { AssemblyPath = "myAssembly.dll", TypeName = "myType", } } }; var manager = new XmlManager(); var xml = manager.XmlSerializeFrom(root); Console.WriteLine(xml); Assert.That(xml, Does.Contain("<custom ")); Assert.That(xml, Does.Contain("assembly-path=\"myAssembly.dll\"")); Assert.That(xml, Does.Contain("type=\"myType\"")); Assert.That(xml, Does.Not.Contain("<parameter")); }
public void Serialize_FileExists_Correct() { var root = new ConditionXml() { Predicates = new List <DecorationConditionXml>() { new FileExistsConditionXml() { Path = "Folder\\", Name = "myFileName.txt", NotEmpty = true } } }; var manager = new XmlManager(); var xml = manager.XmlSerializeFrom(root); Console.WriteLine(xml); Assert.That(xml, Does.Contain("<file-exists ")); Assert.That(xml, Does.Contain("path=\"Folder\\\"")); Assert.That(xml, Does.Contain("name=\"myFileName.txt\"")); Assert.That(xml, Does.Contain("not-empty=\"true\"")); }
public void Serialize_FolderExists_Correct() { var root = new ConditionXml() { Predicates = new List <DecorationConditionXml>() { new FolderExistsConditionXml() { Path = ".", Name = "myFolderName", NotEmpty = false } } }; var manager = new XmlManager(); var xml = manager.XmlSerializeFrom(root); Console.WriteLine(xml); Assert.That(xml, Does.Contain("<folder-exists ")); Assert.That(xml, Does.Contain("path=\".\"")); Assert.That(xml, Does.Contain("name=\"myFolderName\"")); Assert.That(xml, Does.Not.Contain("not-empty")); }
private void ExecuteChecks(ConditionXml check) { foreach (var predicate in check.Predicates) { var impl = new DecorationFactory().Get(predicate); var isVerified = impl.Validate(); if (!isVerified) Assert.Ignore("This test has been ignored because following check wasn't successful: {0}", impl.Message); } }