Skip to content

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

Open
@JeffSchwandt

Description

@JeffSchwandt

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions