public void TestCreateXDDocument() { var d1 = _pool1.CreateXDDocument(); var d2 = _pool2.CreateXDDocument("FO"); var d3 = _pool2.CreateXDDocument("W"); Assert.IsNotNull(d1); Assert.IsNotNull(d2); Assert.IsNotNull(d3); }
public void Initialize() { XD.StartProcess = TestConfig.StartProcess; _pool = XD.Factory.CompileXD(null, new FilePath("xdefs/02.xdef")); _poolCreate = XD.Factory.CompileXD(null, new FilePath("xdefs/03.xdef")); _validFile = "xdefs/02_medium.xml"; _doc = _pool.CreateXDDocument(); _docCreate = _poolCreate.CreateXDDocument(); }
public void TestCreateInvalid() { var createInvalid = _poolCreate.CreateXDDocument(); createInvalid.SetXDContext(File.ReadAllText("xdefs/03_invalid.xml")); var reporter = new ArrayReporter(); var res = createInvalid.Xcreate("A", reporter); var a = reporter.Report; Assert.IsNotNull(res); Assert.IsNull(a); }
public void TestSetProps() { var doc = _pool.CreateXDDocument(); doc.SetProperties(new Utils.Properties() { { "a", "b" }, { "c", "d" } }); var received = doc.GetProperties(); Assert.AreEqual(received.Count, 2); Assert.AreEqual(received["a"], "b"); Assert.AreEqual(received["c"], "d"); }
private void RunXdef(XDPool pool, string xmlFile) { var doc = pool.CreateXDDocument(); var reporter = new ArrayReporter(); using (var stream = new FileStream(xmlFile, FileMode.Open)) { var res = doc.Xparse(stream, reporter); } try { if (reporter.Errors) { throw new Exception("ValidationError"); } } catch (Exception ex) { Trace.WriteLine(reporter); Trace.WriteLine(ex); throw; } }