Exemple #1
0
 public void TestTryProcess_ErrorIfNameMissing()
 {
     Globals.AssertThrows(() => new FieldNodeProcessor().TryProcess(docProcessor, Globals.GetXmlNode("<?field type=\"TestType\"?>"), true, template, renderFunction), (TemplateErrorException ex) => true);
 }
Exemple #2
0
 public void TestTryProcess_ErrorIfBothTypeAndClientType()
 {
     Globals.AssertThrows(() => new FieldNodeProcessor().TryProcess(docProcessor, Globals.GetXmlNode("<?field name=\"testName\" type=\"X\" clientType=\"Y\"?>"), true, template, renderFunction), (TemplateErrorException ex) => true);
 }
Exemple #3
0
 public void TestTryProcess_DoesNotParseElement()
 {
     mocks.ReplayAll();
     Assert.IsFalse(new FieldNodeProcessor().TryProcess(docProcessor, Globals.GetXmlNode("<element></element>"), true, template, renderFunction));
     mocks.VerifyAll();
 }
Exemple #4
0
 public void TestTryProcess_ErrorIfDuplicateMember()
 {
     Expect.Call(template.HasMember("testName")).Return(true);
     mocks.ReplayAll();
     Globals.AssertThrows(() => new FieldNodeProcessor().TryProcess(docProcessor, Globals.GetXmlNode("<?field name=\"testName\" type=\"TestType\"?>"), true, template, renderFunction), (TemplateErrorException ex) => true);
     Assert.AreEqual(0, fragments.Count);
     mocks.VerifyAll();
 }
 public void TestParse_InvalidArrayValueThrows()
 {
     Globals.AssertThrows(() => new IntMarkupParser().Parse("int", true, "43||120", null), (TemplateErrorException ex) => ex.Message == ParserUtils.MakeTypedMarkupErrorMessage("int", true, "43||120"));
 }