From: <nan...@na...> - 2012-03-02 01:58:58
|
From: Ryan Boggs <rm...@gm...> --- tests/NAnt.Core/Tasks/RegexTaskTest.cs | 12 +++++++++--- tests/NAnt.Core/Tasks/StyleTaskTest.cs | 15 ++++++++++----- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/tests/NAnt.Core/Tasks/RegexTaskTest.cs b/tests/NAnt.Core/Tasks/RegexTaskTest.cs index 02545d3..ceb0336 100644 --- a/tests/NAnt.Core/Tasks/RegexTaskTest.cs +++ b/tests/NAnt.Core/Tasks/RegexTaskTest.cs @@ -32,7 +32,9 @@ namespace Tests.NAnt.Core.Tasks { <echo message='${lastword}'/> </project>"; string result = RunBuild(_xml); - Assertion.Assert("Regex did not match properly.\n" + result, result.IndexOf("sentence") != -1); + Assert.AreNotEqual(-1, result.IndexOf("sentence"), + String.Concat("Regex did not match properly.\n", result)); + //Assertion.Assert("Regex did not match properly.\n" + result, result.IndexOf("sentence") != -1); } [Test] @@ -44,8 +46,12 @@ namespace Tests.NAnt.Core.Tasks { <echo message='file=${file}'/> </project>"; string result = RunBuild(_xml); - Assertion.Assert("Regex did not set first property correcty.\n" + result, result.IndexOf(@"path=d:\Temp\SomeDir\SomeDir\") != -1); - Assertion.Assert("Regex did not set second property correcty.\n" + result, result.IndexOf(@"file=bla.xml") != -1); + Assert.AreNotEqual(-1, result.IndexOf(@"path=d:\Temp\SomeDir\SomeDir\"), + String.Concat("Regex did not set first property correcty.\n", result)); + Assert.AreNotEqual(-1, result.IndexOf(@"file=bla.xml"), + String.Concat("Regex did not set second property correcty.\n", result)); + //Assertion.Assert("Regex did not set first property correcty.\n" + result, result.IndexOf(@"path=d:\Temp\SomeDir\SomeDir\") != -1); + //Assertion.Assert("Regex did not set second property correcty.\n" + result, result.IndexOf(@"file=bla.xml") != -1); } [Test] diff --git a/tests/NAnt.Core/Tasks/StyleTaskTest.cs b/tests/NAnt.Core/Tasks/StyleTaskTest.cs index 4a4b205..03e0dbd 100644 --- a/tests/NAnt.Core/Tasks/StyleTaskTest.cs +++ b/tests/NAnt.Core/Tasks/StyleTaskTest.cs @@ -158,7 +158,8 @@ namespace Tests.NAnt.Core.Tasks { RunBuild(String.Format(CultureInfo.InvariantCulture, _xml, _xslSrcFileNameFull, _xmlSrcFileNameFull, outputFN)); - Assertion.Assert("Output file not created.",File.Exists(outputFN) && (new FileInfo(outputFN)).Length > 0); + Assert.IsTrue(File.Exists(outputFN) && (new FileInfo(outputFN)).Length > 0, "Output file not created."); + //Assertion.Assert("Output file not created.",File.Exists(outputFN) && (new FileInfo(outputFN)).Length > 0); } [Test] @@ -177,7 +178,8 @@ namespace Tests.NAnt.Core.Tasks { RunBuild(String.Format(CultureInfo.InvariantCulture, _xml, _xslSrcFileNameFull, _xmlSrcFileNameFull, outputFN)); - Assertion.Assert("Output file not created.",File.Exists(outputFN) && (new FileInfo(outputFN)).Length > 0); + Assert.IsTrue(File.Exists(outputFN) && (new FileInfo(outputFN)).Length > 0, "Output file not created."); + //Assertion.Assert("Output file not created.",File.Exists(outputFN) && (new FileInfo(outputFN)).Length > 0); } [Test] @@ -190,8 +192,10 @@ namespace Tests.NAnt.Core.Tasks { RunBuild(String.Format(CultureInfo.InvariantCulture, _xml, _xslSrcFileNameFull, _xmlSrcFileNameFull, _outputFileExtension)); - Assertion.Assert("Output file not created.",File.Exists(Path.Combine(TempDirName, _xmlSrcFileName + "." + - _outputFileExtension))); + Assert.IsTrue(File.Exists(Path.Combine(TempDirName, _xmlSrcFileName + "." + + _outputFileExtension)), "Output file not created."); + //Assertion.Assert("Output file not created.",File.Exists(Path.Combine(TempDirName, _xmlSrcFileName + "." + + // _outputFileExtension))); } [Test] @@ -211,7 +215,8 @@ namespace Tests.NAnt.Core.Tasks { _xmlSrcFile2NameFull )); string outputFN = Path.Combine(TempDirName, _xmlSrcFileName + "." + _outputFileExtension); - Assertion.Assert("Output file not created.",File.Exists(outputFN) && (new FileInfo(outputFN)).Length > 0); + Assert.IsTrue(File.Exists(outputFN) && (new FileInfo(outputFN)).Length > 0, "Output file not created."); + //Assertion.Assert("Output file not created.",File.Exists(outputFN) && (new FileInfo(outputFN)).Length > 0); } [Test] -- 1.7.7 |