Commits

Patrick Mézard committed 7a42cb5

Add nunit-2.5.8 and fix tests

  • Participants
  • Parent commits 7f58990

Comments (0)

Files changed (4)

File Tests/SettingsTests.cs

     }
 
     [Test] public void DefaultTest() {
-      Assertion.AssertEquals(CompressionLevels.Default, Settings.Default.CompressionLevel);
-      Assertion.AssertEquals(Algorithms.Default, Settings.Default.PreferredAlgorithm);
+      Assert.AreEqual(CompressionLevels.Default, Settings.Default.CompressionLevel);
+      Assert.AreEqual(Algorithms.Default, Settings.Default.PreferredAlgorithm);
     }
 
     [Test] public void EmptyNodeTest() {
       Settings setting = new Settings(MakeNode(rman.GetString("EmptyNode")));
-      Assertion.AssertEquals(CompressionLevels.Default, setting.CompressionLevel);
-      Assertion.AssertEquals(Algorithms.Default, setting.PreferredAlgorithm);
+      Assert.AreEqual(CompressionLevels.Default, setting.CompressionLevel);
+      Assert.AreEqual(Algorithms.Default, setting.PreferredAlgorithm);
     }
 
     [Test] public void DeflateTest() {
       Settings setting = new Settings(MakeNode(rman.GetString("Deflate")));
-      Assertion.AssertEquals(Algorithms.Deflate, setting.PreferredAlgorithm);
-      Assertion.AssertEquals(CompressionLevels.Default, setting.CompressionLevel);
+      Assert.AreEqual(Algorithms.Deflate, setting.PreferredAlgorithm);
+      Assert.AreEqual(CompressionLevels.Default, setting.CompressionLevel);
     }
 
     [Test] public void GZipTest() {
       Settings setting = new Settings(MakeNode(rman.GetString("GZip")));
-      Assertion.AssertEquals(Algorithms.GZip, setting.PreferredAlgorithm);
-      Assertion.AssertEquals(CompressionLevels.Default, setting.CompressionLevel);
+      Assert.AreEqual(Algorithms.GZip, setting.PreferredAlgorithm);
+      Assert.AreEqual(CompressionLevels.Default, setting.CompressionLevel);
     }
 
     [Test] public void HighLevelTest() {
       Settings setting = new Settings(MakeNode(rman.GetString("LevelHigh")));
-      Assertion.AssertEquals(Algorithms.Default, setting.PreferredAlgorithm);
-      Assertion.AssertEquals(CompressionLevels.High, setting.CompressionLevel);
+      Assert.AreEqual(Algorithms.Default, setting.PreferredAlgorithm);
+      Assert.AreEqual(CompressionLevels.High, setting.CompressionLevel);
     }
 
     [Test] public void NormalLevelTest() {
       Settings setting = new Settings(MakeNode(rman.GetString("LevelNormal")));
-      Assertion.AssertEquals(Algorithms.Default, setting.PreferredAlgorithm);
-      Assertion.AssertEquals(CompressionLevels.Normal, setting.CompressionLevel);
+      Assert.AreEqual(Algorithms.Default, setting.PreferredAlgorithm);
+      Assert.AreEqual(CompressionLevels.Normal, setting.CompressionLevel);
     }
 
     [Test] public void LowLevelTest() {
       Settings setting = new Settings(MakeNode(rman.GetString("LevelLow")));
-      Assertion.AssertEquals(Algorithms.Default, setting.PreferredAlgorithm);
-      Assertion.AssertEquals(CompressionLevels.Low, setting.CompressionLevel);
+      Assert.AreEqual(Algorithms.Default, setting.PreferredAlgorithm);
+      Assert.AreEqual(CompressionLevels.Low, setting.CompressionLevel);
     }
 
     [Test] public void BadLevelTest() {
       Settings setting = new Settings(MakeNode(rman.GetString("BadLevel")));
-      Assertion.AssertEquals(CompressionLevels.Default, setting.CompressionLevel);
+      Assert.AreEqual(CompressionLevels.Default, setting.CompressionLevel);
     }
 
     [Test] public void BadAlgorithmTest() {
       Settings setting = new Settings(MakeNode(rman.GetString("BadAlgorithm")));
-      Assertion.AssertEquals(Algorithms.Default, setting.PreferredAlgorithm);
+      Assert.AreEqual(Algorithms.Default, setting.PreferredAlgorithm);
     }
 
     [Test]
     public void AddSettingsTests() {
       Settings setting = new Settings(MakeNode(rman.GetString("DeflateAndHigh")));
-      Assertion.AssertEquals(CompressionLevels.High, setting.CompressionLevel);
-      Assertion.AssertEquals(Algorithms.Deflate, setting.PreferredAlgorithm);
+      Assert.AreEqual(CompressionLevels.High, setting.CompressionLevel);
+      Assert.AreEqual(Algorithms.Deflate, setting.PreferredAlgorithm);
 
       // test adding a null node
       setting.AddSettings(null);
-      Assertion.AssertEquals(CompressionLevels.High, setting.CompressionLevel);
-      Assertion.AssertEquals(Algorithms.Deflate, setting.PreferredAlgorithm);
+      Assert.AreEqual(CompressionLevels.High, setting.CompressionLevel);
+      Assert.AreEqual(Algorithms.Deflate, setting.PreferredAlgorithm);
 
       // test overriding algorithm
       setting.AddSettings(MakeNode(rman.GetString("GZip")));
-      Assertion.AssertEquals(CompressionLevels.High, setting.CompressionLevel);
-      Assertion.AssertEquals(Algorithms.GZip, setting.PreferredAlgorithm);
+      Assert.AreEqual(CompressionLevels.High, setting.CompressionLevel);
+      Assert.AreEqual(Algorithms.GZip, setting.PreferredAlgorithm);
 
       // test overriding compression level
       setting.AddSettings(MakeNode(rman.GetString("LevelLow")));
-      Assertion.AssertEquals(CompressionLevels.Low, setting.CompressionLevel);
-      Assertion.AssertEquals(Algorithms.GZip, setting.PreferredAlgorithm);
+      Assert.AreEqual(CompressionLevels.Low, setting.CompressionLevel);
+      Assert.AreEqual(Algorithms.GZip, setting.PreferredAlgorithm);
 
     }
 
     [Test] public void UserAddedExcludedType() {
       Settings setting = new Settings(MakeNode(rman.GetString("ExcludeBenFoo")));
-      Assertion.Assert(setting.IsExcludedMimeType("ben/foo"));
+      Assert.That(setting.IsExcludedMimeType("ben/foo"));
     }
 
     [Test] public void UserAddedMultipleExcludedTypes() {
       Settings setting = new Settings(MakeNode(rman.GetString("ExcludeMultipleTypes")));
-      Assertion.Assert(setting.IsExcludedMimeType("ben/foo"));
-      Assertion.Assert(setting.IsExcludedMimeType("image/jpeg"));
+      Assert.That(setting.IsExcludedMimeType("ben/foo"));
+      Assert.That(setting.IsExcludedMimeType("image/jpeg"));
     }
 
     [Test] public void UserAddedAndRemovedType() {
       Settings setting = new Settings(MakeNode(rman.GetString("AddAndRemoveSameType")));
-      Assertion.Assert(!setting.IsExcludedMimeType("user/silly"));
+      Assert.That(!setting.IsExcludedMimeType("user/silly"));
     }
 
     [Test] public void UserRemovedExcludedType() {
       Settings setting = new Settings(MakeNode(rman.GetString("ExcludeMultipleTypes")));
-      Assertion.Assert(setting.IsExcludedMimeType("ben/foo"));
-      Assertion.Assert(setting.IsExcludedMimeType("image/jpeg"));
+      Assert.That(setting.IsExcludedMimeType("ben/foo"));
+      Assert.That(setting.IsExcludedMimeType("image/jpeg"));
 
       setting.AddSettings(MakeNode(rman.GetString("RemoveImageJpegExclusion")));
-      Assertion.Assert(setting.IsExcludedMimeType("ben/foo"));
-      Assertion.Assert(!setting.IsExcludedMimeType("image/jpeg"));
+      Assert.That(setting.IsExcludedMimeType("ben/foo"));
+      Assert.That(!setting.IsExcludedMimeType("image/jpeg"));
     }
 
     [Test] public void ChildAddsMimeExclude(){
       Settings parent = Settings.Default;
       parent.AddSettings(MakeNode(rman.GetString("ExcludeBenFoo")));
-      Assertion.Assert(parent.IsExcludedMimeType("ben/foo"));
+      Assert.That(parent.IsExcludedMimeType("ben/foo"));
     }
 
     [Test] public void ExcludeMultiplePaths() {
       Settings setting = new Settings(MakeNode(rman.GetString("ExcludeMultiplePaths")));
-      Assertion.Assert(setting.IsExcludedPath("foo.aspx"));
-      Assertion.Assert(setting.IsExcludedPath("foo/bar.aspx"));
+      Assert.That(setting.IsExcludedPath("foo.aspx"));
+      Assert.That(setting.IsExcludedPath("foo/bar.aspx"));
     }
 
     [Test] public void RemoveExistingPathExclude() {
       Settings setting = new Settings(MakeNode(rman.GetString("ExcludeMultiplePaths")));
       setting.AddSettings(MakeNode(rman.GetString("RemoveFooAspxExclude")));
-      Assertion.Assert(!setting.IsExcludedPath("foo.aspx"));
-      Assertion.Assert(setting.IsExcludedPath("foo/bar.aspx"));
+      Assert.That(!setting.IsExcludedPath("foo.aspx"));
+      Assert.That(setting.IsExcludedPath("foo/bar.aspx"));
     }
 
     private System.Xml.XmlNode MakeNode(string xml) {

File Tests/Tests.csproj

     <ErrorReport>prompt</ErrorReport>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
+    <Reference Include="nunit.framework, Version=2.5.8.10295, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\..\..\Program Files\NUnit 2.4.8\bin\nunit.framework.dll</HintPath>
+      <HintPath>..\Vendor\NUnit-2.5.8\nunit.framework.dll</HintPath>
     </Reference>
     <Reference Include="System">
       <Name>System</Name>