using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; public static class AssertHelper { [Conditional("UNITY_ASSERTIONS")] public static void Implies(bool condition, bool result, string message = "") { if (condition) { } } [Conditional("UNITY_ASSERTIONS")] public static void Implies(bool condition, Func result, string message = "") { if (condition) { } } [Conditional("UNITY_ASSERTIONS")] public static void Implies(string conditionName, bool condition, string resultName, bool result) { } [Conditional("UNITY_ASSERTIONS")] public static void Implies(string conditionName, bool condition, string resultName, Func result) { if (condition) { } } [Conditional("UNITY_ASSERTIONS")] public static void Contains(T value, IEnumerable collection, string message = "") { if (!collection.Contains(value)) { string str = "The value " + value + " was not found in the collection ["; bool flag = true; foreach (T t in collection) { if (!flag) { str += ", "; flag = false; } str += t.ToString(); } str = str + "]\n" + message; } } }