Skip to content

Control character encoding is inconsistent between TestCase[Source] and TestFixture[Source]. #2835

@estrizhok

Description

@estrizhok

Given the following class:

[TestFixture("X\nY\r\nZ")]
public class Tests
{
  public Tests(string x) { }

  [TestCase("X\nY\r\nZ")]
  public void TestCase(string p1) { }
}

NUnit test exploration produces the following results (I removed irrelevant elements and attributes):

<test-suite type="ParameterizedFixture"
                  fullname="TestProject25.Tests"
                  classname="TestProject25.Tests">
  <test-suite type="TestFixture" 
                    name="Tests(&quot;X&#xA;Y&#xD;&#xA;Z&quot;)"
                    fullname="TestProject25.Tests(&quot;X&#xA;Y&#xD;&#xA;Z&quot;)"
                    classname="TestProject25.Tests">
    <test-suite type="ParameterizedMethod" 
                      name="TestCase" 
                      fullname="TestProject25.Tests.TestCase" 
                      classname="TestProject25.Tests">
      <test-case name="TestCase(&quot;X\nY\r\nZ&quot;)"
                       fullname="TestProject25.Tests(&quot;X&#xA;Y&#xD;&#xA;Z&quot;).TestCase(&quot;X\nY\r\nZ&quot;)" 
                       methodname="TestCase" 
                       classname="TestProject25.Tests" />
    </test-suite>
  </test-suite>

Note different ways to present control characters that appear inside the values for TestFixture and TestCase.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions