public void StringDataWithEmbeddedNullCreatesValidXml()
    {
        string expectedDisplayName = @"TheoryCommandTests+DummyWithAttributes.StringMethod(s: ""\0"")";
        string expectedXml = @"<start name=""TheoryCommandTests+DummyWithAttributes.StringMethod(s: &quot;\0&quot;)"" type=""TheoryCommandTests+DummyWithAttributes"" method=""StringMethod"" />";

        TheoryCommand command = new TheoryCommand(Reflector.Wrap(typeof(DummyWithAttributes).GetMethod("StringMethod")), new object[] { "\0" });

        Assert.Equal(expectedDisplayName, command.DisplayName);
        Assert.Equal(expectedXml, command.ToStartXml().OuterXml);
    }
Exemple #2
0
        public void StringDataWithEmbeddedNullCreatesValidXml()  // CodePlex issue #9755
        {
            string expectedXml = @"<start name=""Xunit1.Extensions.TheoryCommandTests+DummyWithAttributes.StringMethod(s: &quot;\x0\xFFFF&quot;)"" type=""Xunit1.Extensions.TheoryCommandTests+DummyWithAttributes"" method=""StringMethod"" />";

            TheoryCommand command = new TheoryCommand(Reflector.Wrap(typeof(DummyWithAttributes).GetMethod("StringMethod")), new object[] { "\0\xffff" });

            Assert.Equal(expectedXml, command.ToStartXml().OuterXml);
        }