public void SanitizePrefixedAndSuffixedAlternateSeparatorTest() { const string s = @"/asdf/"; Assert.AreEqual("asdf", ContentAssetName.Sanitize(s)); }
public void SanitizeAlternateSeparatorTest() { const string s = @"asdf/basdf/wer/asdf"; Assert.AreEqual(s.Replace("/", ContentAssetName.PathSeparator), ContentAssetName.Sanitize(s)); }
public void SanitizeSeparatorTest() { const string s = @"asdf\basdf\wer\asdf"; Assert.AreEqual(s.Replace("\\", ContentAssetName.PathSeparator), ContentAssetName.Sanitize(s)); }
public void SanitizeSuffixedSeparatorTest() { const string s = @"asdf\"; Assert.AreEqual("asdf", ContentAssetName.Sanitize(s)); }
/// <summary> /// Gets the sanitized text for this <see cref="AutoValidateTextBox"/>. This should always be used when /// you want to make use of the contents of the <see cref="AutoValidateTextBox"/>. The sanitized /// text is only guaranteed to be valid if IsValid is true. /// </summary> /// <param name="text">The text to sanitize.</param> /// <returns> /// The sanitized text for this <see cref="AutoValidateTextBox"/>. /// </returns> public override string GetSanitizedText(string text) { return(ContentAssetName.Sanitize(text)); }