Exemplo n.º 1
0
 public void NormalizeString_WhenReplaceIsNull_Throws()
 {
     Assert.Throws <ArgumentNullException>(() => NormalizationUtils.NormalizeString("foo", c => true, null));
 }
Exemplo n.º 2
0
 public void NormalizeXmlText_WhenTextIsNull_ReturnsNull()
 {
     Assert.IsNull(NormalizationUtils.NormalizeXmlText(null));
 }
Exemplo n.º 3
0
 public void NormalizeXmlText_WhenStringIsEmpty_ReturnsEmpty()
 {
     Assert.IsEmpty(NormalizationUtils.NormalizeString("", c => true, c => ""));
 }
Exemplo n.º 4
0
 public void NormalizeString_WhenValidIsNull_Throws()
 {
     Assert.Throws <ArgumentNullException>(() => NormalizationUtils.NormalizeString("foo", null, c => ""));
 }
Exemplo n.º 5
0
 /// <summary>
 /// Normalizes a test, step or parameter name.
 /// </summary>
 /// <param name="name">The name, or null if none.</param>
 /// <returns>The normalized name, or null if none.  May be the same instance if <paramref name="name"/>
 /// was already normalized.</returns>
 public static string NormalizeTestComponentName(string name)
 {
     return(NormalizationUtils.NormalizeName(name));
 }
Exemplo n.º 6
0
 public void NormalizeString_WhenStringIsNull_ReturnsNull()
 {
     Assert.IsNull(NormalizationUtils.NormalizeString(null, c => true, c => ""));
 }
 /// <summary>
 /// Normalizes a stream name.
 /// </summary>
 /// <param name="streamName">The stream name, or null if none.</param>
 /// <returns>The normalized stream name, or null if none.  May be the same instance if <paramref name="streamName"/>
 /// was already normalized.</returns>
 public static string NormalizeStreamName(string streamName)
 {
     return(NormalizationUtils.NormalizeName(streamName));
 }
Exemplo n.º 8
0
 public void NormalizeXmlText_WhenTextIsNotNormalized_ReturnsNormalizedInstance(string text,
                                                                                string normalizedText)
 {
     Assert.AreEqual(normalizedText, NormalizationUtils.NormalizeXmlText(text));
 }
 /// <summary>
 /// Normalizes a content type.
 /// </summary>
 /// <param name="contentType">The content type, or null if none.</param>
 /// <returns>The normalized content type, or null if none.  May be the same instance if <paramref name="contentType"/>
 /// was already normalized.</returns>
 public static string NormalizeContentType(string contentType)
 {
     return(NormalizationUtils.NormalizePrintableASCII(contentType));
 }
Exemplo n.º 10
0
 /// <summary>
 /// Normalizes an attachment name.
 /// </summary>
 /// <param name="attachmentName">The attachment name, or null if none.</param>
 /// <returns>The normalized attachment name, or null if none.  May be the same instance if <paramref name="attachmentName"/>
 /// was already normalized.</returns>
 public static string NormalizeAttachmentName(string attachmentName)
 {
     return(NormalizationUtils.NormalizeName(attachmentName));
 }
Exemplo n.º 11
0
 /// <summary>
 /// Normalizes a metadata value.
 /// </summary>
 /// <param name="metadataValue">The metadata value, or null if none.</param>
 /// <returns>The normalized metadata value, or null if none.  May be the same instance if <paramref name="metadataValue"/>
 /// was already normalized.</returns>
 public static string NormalizeMetadataValue(string metadataValue)
 {
     return(NormalizationUtils.NormalizeXmlText(metadataValue));
 }
Exemplo n.º 12
0
 /// <summary>
 /// Normalizes a metadata key.
 /// </summary>
 /// <param name="metadataKey">The metadata key, or null if none.</param>
 /// <returns>The normalized metadata key, or null if none.  May be the same instance if <paramref name="metadataKey"/>
 /// was already normalized.</returns>
 public static string NormalizeMetadataKey(string metadataKey)
 {
     return(NormalizationUtils.NormalizeName(metadataKey));
 }
Exemplo n.º 13
0
 /// <summary>
 /// Normalizes a lifecycle phase.
 /// </summary>
 /// <param name="lifecyclePhase">The lifecycle phase, or null if none.</param>
 /// <returns>The normalized lifecycle phase, or null if none.  May be the same instance if <paramref name="lifecyclePhase"/>
 /// was already normalized.</returns>
 public static string NormalizeLifecyclePhase(string lifecyclePhase)
 {
     return(NormalizationUtils.NormalizeName(lifecyclePhase));
 }
Exemplo n.º 14
0
 public void NormalizeXmlText_WhenTextIsEmpty_ReturnsEmpty()
 {
     Assert.IsEmpty(NormalizationUtils.NormalizeXmlText(""));
 }
Exemplo n.º 15
0
 /// <summary>
 /// Normalizes a section name.
 /// </summary>
 /// <param name="sectionName">The section name, or null if none.</param>
 /// <returns>The normalized section name, or null if none.  May be the same instance if <paramref name="sectionName"/>
 /// was already normalized.</returns>
 public static string NormalizeSectionName(string sectionName)
 {
     return(NormalizationUtils.NormalizeName(sectionName));
 }
Exemplo n.º 16
0
 public void NormalizeXmlText_WhenTextIsAlreadyNormalized_ReturnsTheSameInstance(string text)
 {
     Assert.AreSame(text, NormalizationUtils.NormalizeXmlText(text));
 }
Exemplo n.º 17
0
 /// <summary>
 /// Normalizes markup text.
 /// </summary>
 /// <param name="text">The text, or null if none.</param>
 /// <returns>The normalized text, or null if none.  May be the same instance if <paramref name="text"/>
 /// was already normalized.</returns>
 public static string NormalizeText(string text)
 {
     return(NormalizationUtils.NormalizeXmlText(text));
 }
Exemplo n.º 18
0
 /// <inheritdoc />
 public TestOutcome Normalize()
 {
     return(new TestOutcome(status, NormalizationUtils.NormalizeXmlText(category)));
 }
Exemplo n.º 19
0
 /// <summary>
 /// Normalizes a test, step or parameter id.
 /// </summary>
 /// <param name="id">The id, or null if none.</param>
 /// <returns>The normalized id, or null if none.  May be the same instance if <paramref name="id"/>
 /// was already normalized.</returns>
 public static string NormalizeTestComponentId(string id)
 {
     return(NormalizationUtils.NormalizePrintableASCII(id));
 }