Files
WireMock.Net/test/WireMock.Net.Tests/OpenApiParser/PathUtilsTests.cs
Stef Heyenrath 4368e3cde6 1.7.x (#1268)
* Fix construction of path in OpenApiParser (#1265)

* Server-Sent Events (#1269)

* Server Side Events

* fixes

* await HandleSseStringAsync(responseMessage, response, bodyData);

* 1.7.5-preview-01

* IBlockingQueue

* 1.7.5-preview-02 (03 April 2025)

* IBlockingQueue

* ...

* Support OpenApi V31 (#1279)

* Support OpenApi V31

* Update src/WireMock.Net.OpenApiParser/Extensions/OpenApiSchemaExtensions.cs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* fx

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Add ProtoDefinitionHelper.FromDirectory (#1263)

* Add ProtoDefinitionHelper.FromDirectory

* .

* unix-windows

* move test

* imports in the proto files indeed should use a forward slash

* updates

* .

* private Func<IdOrTexts> ProtoDefinitionFunc()

* OpenTelemetry

* .

* fix path utils

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-04-23 11:51:44 +02:00

40 lines
1017 B
C#

// Copyright © WireMock.Net
#if !(NET452 || NET461 || NETCOREAPP3_1)
using FluentAssertions;
using WireMock.Net.OpenApiParser.Utils;
using Xunit;
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");
}
}
#endif