mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-02-18 08:17:43 +01:00
37 lines
957 B
C#
37 lines
957 B
C#
// Copyright © WireMock.Net
|
|
|
|
using AwesomeAssertions;
|
|
using WireMock.Net.OpenApiParser.Utils;
|
|
|
|
namespace WireMock.Net.Tests.OpenApiParser;
|
|
|
|
public class PathUtilsTests
|
|
{
|
|
[Theory]
|
|
[InlineData(new string[] { }, "")]
|
|
[InlineData(new[] { "path1" }, "path1")]
|
|
[InlineData(new[] { "/path1" }, "/path1")]
|
|
[InlineData(new[] { "/path1/" }, "/path1")]
|
|
public void Combine_ShouldReturnCombinedPathTest1(string[] paths, string expected)
|
|
{
|
|
// Act
|
|
var result = PathUtils.Combine(paths);
|
|
|
|
// Assert
|
|
result.Should().Be(expected);
|
|
}
|
|
|
|
[Theory]
|
|
[InlineData("/path1", "path2")]
|
|
[InlineData("/path1/", "path2")]
|
|
[InlineData("/path1", "/path2")]
|
|
[InlineData("/path1", "path2/")]
|
|
public void Combine_ShouldReturnCombinedPathTest2(params string[] paths)
|
|
{
|
|
// Act
|
|
var result = PathUtils.Combine(paths);
|
|
|
|
// Assert
|
|
result.Should().Be("/path1/path2");
|
|
}
|
|
} |