Welcome to mirror list, hosted at ThFree Co, Russian Federation.

NvdlValidatingReaderTests.cs « Test « Commons.Xml.Relaxng « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bb0f740dc489972b7ed2a6b14ce0cd4350106718 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//
// 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 ();
			}				
		}
	}
}