Пример #1
0
 public static void AreEqual(MediaTypeHeaderValue expected, MediaTypeHeaderValue actual, string errorMessage)
 {
     if (expected != null || actual != null)
     {
         Assert.IsNotNull(expected, string.Format("{0}  Expected media type should not be null.", errorMessage));
         Assert.IsTrue(MediaTypeHeaderValueComparer.Equals(expected, actual), string.Format("{0}  Expected media type '{1}' but found media type '{2}'.", errorMessage, expected, actual));
     }
 }
Пример #2
0
 public static void AreEqual(string expected, string actual, string errorMessage)
 {
     if (!string.IsNullOrEmpty(expected) || !string.IsNullOrEmpty(actual))
     {
         Assert.IsNotNull(expected, string.Format("{0}: expected media type should not be null.", errorMessage));
         MediaTypeHeaderValue expectedMediaType = new MediaTypeHeaderValue(expected);
         MediaTypeHeaderValue actualMediaType   = new MediaTypeHeaderValue(actual);
         Assert.IsTrue(MediaTypeHeaderValueComparer.Equals(expectedMediaType, actualMediaType), string.Format("{0}  Expected media type '{1}' but found media type '{2}'.", errorMessage, expected, actual));
     }
 }