linux-packaging-mono/mcs/class/Commons.Xml.Relaxng/Test/NvdlValidatingReaderTests.cs
Xamarin Public Jenkins (auto-signing) 0510252385 Imported Upstream version 5.20.0.180
Former-commit-id: ff953ca879339fe1e1211f7220f563e1342e66cb
2019-02-04 20:11:37 +00:00

50 lines
1.1 KiB
C#

//
// NvdlValidatingReaderTests.cs
//
// Authors:
// Atsushi Enomoto <atsushi@ximian.com>
//
// Copyright (C) 2006 Novell Inc.
//
using System;
using System.IO;
using System.Xml;
using Commons.Xml.Nvdl;
using NUnit.Framework;
using MonoTests.Helpers;
namespace MonoTests.Commons.Xml.Relaxng
{
[TestFixture]
public class NvdlValidatingReaderTests
{
[Test]
public void ReadNvdlNvdl ()
{
using (TextReader r = File.OpenText (TestResourceHelper.GetFullPathOfResource ("Test/XmlFiles/nvdl.nvdl"))) {
NvdlRules rules = NvdlReader.Read (
new XmlTextReader (r));
}
}
[Test]
public void ValidateNvdlNvdl ()
{
NvdlRules rules = null;
string path = TestResourceHelper.GetFullPathOfResource ("Test/XmlFiles/nvdl.nvdl");
using (TextReader r = File.OpenText (path)) {
rules = NvdlReader.Read (
new XmlTextReader (path, r));
}
using (TextReader r = File.OpenText (path)) {
XmlTextReader xtr = new XmlTextReader (path, r);
NvdlValidatingReader vr = new NvdlValidatingReader (xtr, rules);
while (!vr.EOF)
vr.Read ();
}
}
}
}