Ejemplo n.º 1
0
 public static void AreNotSame(object notExpected, object actual, string message, params object[] parameters)
 {
     if (object.ReferenceEquals(notExpected, actual))
     {
         string str = TracingHelper.FormatMessage("Assert.AreNotSame NotExcepted:{0} = Actual:{1}", notExpected, actual);
         HandleFail(str, message, parameters);
     }
 }
Ejemplo n.º 2
0
 public static void AreEqual <T>(T expected, T actual, string message, params object[] parameters)
 {
     if (!object.Equals(expected, actual))
     {
         string str = TracingHelper.FormatMessage("Assert.AreEqual Excepted:{0} != Actual: {1} ", expected, actual);
         HandleFail(str, message, parameters);
     }
 }
Ejemplo n.º 3
0
 public static void AreNotEqual(float notExpected, float actual, float delta, string message, params object[] parameters)
 {
     if (Math.Abs((float)(notExpected - actual)) <= delta)
     {
         string str = TracingHelper.FormatMessage("Assert.AreEqual NotExcepted:{0} - Actual:{1} < Delta: {2}", notExpected, actual, delta);
         HandleFail(str, message, parameters);
     }
 }
Ejemplo n.º 4
0
 public static void AreEqual(double expected, double actual, double delta, string message, params object[] parameters)
 {
     if (Math.Abs((double)(expected - actual)) > delta)
     {
         string str = TracingHelper.FormatMessage("Assert.AreEqual Excepted:{0} - Actual:{1} > delta: {2}", expected, actual, delta);
         HandleFail(str, message, parameters);
     }
 }
Ejemplo n.º 5
0
 public static void AreNotEqual(string notExpected, string actual, bool ignoreCase, CultureInfo culture, string message, params object[] parameters)
 {
     // CheckParameterNotNull(culture, "Assert.AreNotEqual", "culture", string.Empty, new object[0]);
     if (string.Compare(notExpected, actual, ignoreCase, culture) == 0)
     {
         string str = TracingHelper.FormatMessage("Assert.AreNotEqual Excepted:{0} != Actual: {1} {2}Culture: {3}", notExpected, actual, ignoreCase ? "IgnoreCase " : "", culture);
         HandleFail(str, message, parameters);
     }
 }
Ejemplo n.º 6
0
 public static void IsNotInstanceOfType(object value, Type wrongType, string message, params object[] parameters)
 {
     if (wrongType == null)
     {
         HandleFail("Assert.IsNotInstanceOfType expectedType == null", message, parameters);
     }
     if ((value != null) && wrongType.IsInstanceOfType(value))
     {
         string str = TracingHelper.FormatMessage("Assert.IsNotInstanceOfType {0} is {1}", value, wrongType);
         HandleFail(str, message, parameters);
     }
 }
Ejemplo n.º 7
0
        public static void Error(LogEventID eventId, Exception ex, string format, params object[] args)
        {
            string message = TracingHelper.FormatMessage(format, args) + "\r\n" + ex.ToString();

            WriteEventLog(EventLogEntryType.Error, message, eventId);
        }
Ejemplo n.º 8
0
        public static void Error(LogEventID eventId, string format, params object[] args)
        {
            string message = TracingHelper.FormatMessage(format, args);

            WriteEventLog(EventLogEntryType.Error, message, eventId);
        }
Ejemplo n.º 9
0
        internal static void HandleFail(string info, string extra, params object[] args)
        {
            string s = TracingHelper.FormatMessage(extra, args);

            throw new IICAssertFailedException("Failed! " + info + " \'" + s + "\'");
        }