public void StringDataWithEmbeddedNullCreatesValidXml() // CodePlex issue #9755 { string expectedXml = @"<start name=""Xunit1.Extensions.TheoryCommandTests+DummyWithAttributes.StringMethod(s: "\x0\xFFFF")"" 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); }
public void StringDataWithEmbeddedNullCreatesValidXml() // CodePlex issue #9755, � is not valid XML, so we replace it with \0 { string expectedDisplayName = @"TheoryCommandTests+DummyWithAttributes.StringMethod(s: ""\0"")"; string expectedXml = @"<start name=""TheoryCommandTests+DummyWithAttributes.StringMethod(s: "\0")"" 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); }