CSharp examples for System:Object
Is Equals for two objects
using System;// w ww. j ava 2s. com public class Main{ /// <summary> /// /// </summary> /// <param name="expectedValue"></param> /// <param name="actualValue"></param> /// <param name="message"></param> public static void IsEquals(Object expectedValue, Object actualValue, string message) { if (!actualValue.Equals(expectedValue)) throw new AssertionFailedException("Expected " + expectedValue + " but encountered " + actualValue + (message != null ? ": " + message : String.Empty)); } /// <summary> /// /// </summary> /// <param name="expectedValue"></param> /// <param name="actualValue"></param> public static void IsEquals(Object expectedValue, Object actualValue) { IsEquals(expectedValue, actualValue, null); } }