[Fat-develop] FAT/test/FAT.Test/Core ConfigurationTest.cs,1.2,1.3
Brought to you by:
exortech
|
From: <exo...@us...> - 2004-01-20 06:01:28
|
Update of /cvsroot/fat/FAT/test/FAT.Test/Core
In directory sc8-pr-cvs1:/tmp/cvs-serv9446/test/FAT.Test/Core
Modified Files:
ConfigurationTest.cs
Log Message:
parser is now configurable. configuration is used as factory for parser
Index: ConfigurationTest.cs
===================================================================
RCS file: /cvsroot/fat/FAT/test/FAT.Test/Core/ConfigurationTest.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ConfigurationTest.cs 15 Jan 2004 00:56:58 -0000 1.2
--- ConfigurationTest.cs 20 Jan 2004 06:01:20 -0000 1.3
***************
*** 61,69 ****
public void CreateTestFileScanner()
{
! string xml = String.Format(@"<FAT><TestPaths><TestPath>foo</TestPath></TestPaths></FAT>");
ITestFileScanner scanner = new FATConfiguration(LoadXml(xml)).TestFileScanner;
AssertNotNull(scanner);
}
}
}
--- 61,103 ----
public void CreateTestFileScanner()
{
! string xml = String.Format(@"<FAT><TestPaths><TestPath>foo</TestPath></TestPaths></FAT>");
ITestFileScanner scanner = new FATConfiguration(LoadXml(xml)).TestFileScanner;
AssertNotNull(scanner);
}
+
+ [Test]
+ public void CreateParserFromConfigurationXml()
+ {
+ string xml = String.Format(@"<FAT><Parser>FAT.Test.Core.ConfigurationTest+MockParser,FAT.Test</Parser></FAT>");
+ ITestParser parser = new FATConfiguration(LoadXml(xml)).TestParser;
+ AssertEquals(typeof(MockParser), parser.GetType());
+ }
+
+ [Test]
+ public void CreateDefaultParser()
+ {
+ ITestParser parser = new FATConfiguration(LoadXml("<FAT/>")).TestParser;
+ AssertEquals(typeof(TestParser), parser.GetType());
+ }
+
+ [Test]
+ public void CreateDefaultRunner()
+ {
+ ITestRunner runner = new FATConfiguration(LoadXml("<FAT/>")).TestRunner;
+ AssertEquals(typeof(TestRunner), runner.GetType());
+ }
+
+ class MockParser : ITestParser
+ {
+ public FAT.Core.ITest Parse(string testName, string testContent, string setup, string teardown)
+ {
+ return null;
+ }
+ public FAT.Core.ITest Parse(string testName, string testContent)
+ {
+ return null;
+ }
+ }
}
}
|