public void CleanXml_EscapedNonEmptyXmlAttributeWithSeparateClosingTag_ShouldReplaceDoubleQuotes() { const string sample = "<xml attr=\"\"Test\"\" ></xml>"; const string expected = "<xml attr=\"Test\" ></xml>"; var context = new XmlCleanerContext() { XmlToClean = sample }; var sut = new VisualStudioVBScriptCleaner(); sut.CleanXml(context); Assert.AreEqual(expected, context.XmlToClean); }
public void CleanXml_EscapedNonEmptyXmlAttributeSurroundedBySingleQuotes_ShouldReplaceDoubleQuotes() { const string sample = "<xml attr='Test \"\"THE\"\" thing.' />"; const string expected = "<xml attr='Test \"THE\" thing.' />"; var context = new XmlCleanerContext() { XmlToClean = sample }; var sut = new VisualStudioVBScriptCleaner(); sut.CleanXml(context); Assert.AreEqual(expected, context.XmlToClean); }
public void CleanXml_NonEscapedEmptyXmlAttribute_ShouldNotReplaceDoubleQuotes() { const string sample = "<xml attr=\"\" />"; var context = new XmlCleanerContext() { XmlToClean = sample }; var sut = new VisualStudioVBScriptCleaner(); sut.CleanXml(context); Assert.AreEqual(sample, context.XmlToClean); }
public void CleanXml_NonEscapedEmptyXmlAttributeWithNoWhitespaceAfterWithSeparateClosingTag_ShouldNotReplaceDoubleQuotes() { const string sample = "<xml attr=\"\"></xml>"; var context = new XmlCleanerContext() { XmlToClean = sample }; var sut = new VisualStudioVBScriptCleaner(); sut.CleanXml(context); Assert.AreEqual(sample, context.XmlToClean); }