mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-04-24 09:48:51 +02:00
Fix WithBody when using Pact and added more nullable annotations (#783)
* More nullable annotations * . * . * FIX * pact * . * p * xxx * ... * auth * array * ...
This commit is contained in:
@@ -1,44 +1,43 @@
|
||||
using NFluent;
|
||||
using NFluent;
|
||||
using System.IO;
|
||||
using WireMock.Util;
|
||||
using Xunit;
|
||||
|
||||
namespace WireMock.Net.Tests.Util
|
||||
namespace WireMock.Net.Tests.Util;
|
||||
|
||||
public class PathUtilsTests
|
||||
{
|
||||
public class PathUtilsTests
|
||||
[Theory]
|
||||
[InlineData(@"subdirectory/MyXmlResponse.xml")]
|
||||
[InlineData(@"subdirectory\MyXmlResponse.xml")]
|
||||
public void PathUtils_CleanPath(string path)
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(@"subdirectory/MyXmlResponse.xml")]
|
||||
[InlineData(@"subdirectory\MyXmlResponse.xml")]
|
||||
public void PathUtils_CleanPath(string path)
|
||||
{
|
||||
// Act
|
||||
var cleanPath = PathUtils.CleanPath(path);
|
||||
// Act
|
||||
var cleanPath = PathUtils.CleanPath(path);
|
||||
|
||||
// Assert
|
||||
Check.That(cleanPath).Equals("subdirectory" + Path.DirectorySeparatorChar + "MyXmlResponse.xml");
|
||||
}
|
||||
// Assert
|
||||
Check.That(cleanPath).Equals("subdirectory" + Path.DirectorySeparatorChar + "MyXmlResponse.xml");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null, null)]
|
||||
[InlineData("", "")]
|
||||
[InlineData("a", "a")]
|
||||
[InlineData(@"/", "")]
|
||||
[InlineData(@"//", "")]
|
||||
[InlineData(@"//a", "a")]
|
||||
[InlineData(@"\", "")]
|
||||
[InlineData(@"\\", "")]
|
||||
[InlineData(@"\\a", "a")]
|
||||
public void PathUtils_CleanPath_RemoveLeadingDirectorySeparators(string path, string expected)
|
||||
{
|
||||
// Arrange
|
||||
var cleanPath = PathUtils.CleanPath(path);
|
||||
[Theory]
|
||||
[InlineData(null, null)]
|
||||
[InlineData("", "")]
|
||||
[InlineData("a", "a")]
|
||||
[InlineData(@"/", "")]
|
||||
[InlineData(@"//", "")]
|
||||
[InlineData(@"//a", "a")]
|
||||
[InlineData(@"\", "")]
|
||||
[InlineData(@"\\", "")]
|
||||
[InlineData(@"\\a", "a")]
|
||||
public void PathUtils_CleanPath_RemoveLeadingDirectorySeparators(string path, string expected)
|
||||
{
|
||||
// Arrange
|
||||
var cleanPath = PathUtils.CleanPath(path);
|
||||
|
||||
// Act
|
||||
var withoutDirectorySeparators = PathUtils.RemoveLeadingDirectorySeparators(cleanPath);
|
||||
// Act
|
||||
var withoutDirectorySeparators = PathUtils.RemoveLeadingDirectorySeparators(cleanPath);
|
||||
|
||||
// Assert
|
||||
Check.That(withoutDirectorySeparators).Equals(expected);
|
||||
}
|
||||
// Assert
|
||||
Check.That(withoutDirectorySeparators).Equals(expected);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user