Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
Fix tests broken by NUnit 4 upgrade.
  • Loading branch information
martincostello committed Nov 27, 2023
1 parent 8be6287 commit 05fd403
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions PseudoLocalizer.Core.Tests/POProcessorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.IO;
using System.Linq;
using NUnit.Framework;
using NUnit.Framework.Legacy;

namespace PseudoLocalizer.Core.Tests
{
Expand All @@ -28,6 +29,7 @@ public void ShouldLeaveTheFileUntouchedWhenUsingAnIdentityTransformation()
processor.Transform(inputStream, outputStream);
}

Assert.That(OutputFileName, Does.Exist);
FileAssert.AreEqual(Test1FileName, OutputFileName);
}

Expand All @@ -42,6 +44,7 @@ public void ShouldReverseStringsButLeaveTheCommentsUntouchedWhenTransformingWith
processor.Transform(inputStream, outputStream);
}

Assert.That(OutputFileName, Does.Exist);
FileAssert.AreEqual("Mirror.po", OutputFileName);
}

Expand All @@ -56,6 +59,7 @@ public void ShouldAddFunnyAccentsWhenTransformingWithTheAccenterTransformation()
processor.Transform(inputStream, outputStream);
}

Assert.That(OutputFileName, Does.Exist);
FileAssert.AreEqual("Accents.po", OutputFileName);
}

Expand All @@ -72,6 +76,7 @@ public void ShouldApplyMultipleTransformations()
processor.Transform(inputStream, outputStream);
}

Assert.That(OutputFileName, Does.Exist);
FileAssert.AreEqual("Multiple.po", OutputFileName);
}

Expand All @@ -88,8 +93,8 @@ public void ShouldThrowForBadInputFile()
ex = Assert.Throws<POFileFormatException>(() => processor.Transform(inputStream, outputStream));
}

Assert.AreEqual("Entry beginning at 18,1 must not have an empty id." + Environment.NewLine, ex.Message);
Assert.AreEqual("Entry beginning at 18,1 must not have an empty id.", ex.DiagnosticMessages.First());
Assert.That(ex.Message, Is.EqualTo("Entry beginning at 18,1 must not have an empty id." + Environment.NewLine));
Assert.That(ex.DiagnosticMessages.First(), Is.EqualTo("Entry beginning at 18,1 must not have an empty id."));
}

private static void DeleteOutputFile()
Expand Down

0 comments on commit 05fd403

Please sign in to comment.