Skip to content

Commit 40b9416 "Allow adding empty value for URL segments" introduces failing tests #2288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
JeffSchwandt opened this issue Mar 19, 2025 · 0 comments
Labels

Comments

@JeffSchwandt
Copy link

Describe the bug
Commit 40b9416 changed 'src/RestSharp/Parameters/UrlSegmentParameter.cs' to allow adding empty value to URL segments.

The same commit split 'test/RestSharp.Tests/UrlBuilderTests.cs' into separate files, 'test/RestSharp.Tests/UrlBuilderTests.Post.cs' and 'test/RestSharp.Tests/UrlBuilderTests.Get.cs'.

The latter contains an existing test called 'GET_with_resource_containing_null_token' which now fails in all 3 runs.

To Reproduce
Failure of this test can be observed in the last two Test Results and by running unit tests in Visual Studio.

Expected behavior
The expected behavior is for all tests to pass. Since Commit 40b9416 "Allow adding empty value for URL segments" breaks 'GET_with_resource_containing_null_token', that test should probably be removed.

Stack trace
Assert.Throws() Failure: No exception was thrown
Expected: typeof(System.ArgumentNullException)
at Xunit.Assert.Throws(Type exceptionType, Exception exception) in //src/xunit.assert/Asserts/ExceptionAsserts.cs:line 47
at Xunit.Assert.Throws[T](Func`1 testCode) in /
/src/xunit.assert/Asserts/ExceptionAsserts.cs:line 113
at RestSharp.Tests.UrlBuilderTests.GET_with_resource_containing_null_token() in C:\Source\Repos\JeffSchwandt\RestSharp\test\RestSharp.Tests\UrlBuilderTests.Get.cs:line 110

Desktop (please complete the following information):

  • OS: Edition Windows 11 Enterprise
    • Version: 23H2
    • OS build: 22631.5039
  • .NET version: net48, net8.0, net9.0
  • IDE: Microsoft Visual Studio Enterprise 2022 (64-bit) - Current Version 17.13.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant