Refactored yet again to give extensible support for the retrieval and assignment...
[castle.git] / Experiments / IronPythonViewEngine / Castle.MonoRail.Views.IronView.Tests / ViewParserTestCase.cs
blob676d5d770c674b8d527abe410fccc5f51b1dd669
1 // Copyright 2004-2007 Castle Project - http://www.castleproject.org/
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle.MonoRail.Views.IronView.Tests
17 using System;
18 using System.IO;
19 using NUnit.Framework;
21 [TestFixture]
22 public class ViewParserTestCase
24 [Test]
25 public void CreateScripts()
27 // ViewParser parser = new ViewParser();
28 //
29 // String[] files = Directory.GetFiles("../../ViewsToTest", "*.py");
30 //
31 // foreach(String file in files)
32 // {
33 // String resultFileName =
34 // Path.Combine(Path.GetDirectoryName(file),
35 // String.Format("{0}-result.txt", Path.GetFileNameWithoutExtension(file)));
37 // using(StreamReader reader = new StreamReader(file))
38 // {
39 // String result = parser.CreateScriptFromFile(reader, file);
41 // // Debug.WriteLine(result);
42 // Console.WriteLine(result);
44 // AssertResultEqualsToResultFileContent(result, resultFileName);
45 // }
46 // }
49 private void AssertResultEqualsToResultFileContent(string script, string resultFileName)
51 using(StreamReader reader = new StreamReader(resultFileName))
53 String fileContent = reader.ReadToEnd();
55 Assert.AreEqual(fileContent, script, "Resulting script should be equal");