} /// <summary>Performs a specified binary operation check</summary> public static Result That(object lhs, string operation, object rhs, string name = "", string text = "") { //return That(lhs, operation, rhs, ResultStatus.Failed, name, text); name = MyResult.BestName(name); text = MyResult.BestText(name, text); Result result = new Result(lhs, operation, rhs, name, text); MyResult += result; return(MyResult); }
// ---------------------------------------------------------------------------------------- /// <!-- That --> /// <summary> /// Performs a binary operation check but sets failures to specified status /// </summary> /// <param name="lhs"></param> /// <param name="operation"></param> /// <param name="rhs"></param> /// <param name="statusIfFail"></param> /// <param name="name">often class name but sometimes test sequence name</param> /// <param name="text">often method name but sometimes test name</param> /// <returns></returns> /// <remarks>Is.Ok here does the heavy lifting</remarks> public static Result That(object lhs, string operation, object rhs, ResultStatus statusIfFail, string name = "", string text = "") //public static AssertResult That(object lhs, string operation, object rhs, [System.Runtime.CompilerServices.CallerMemberName]string text = "") // C# 4.5 { name = MyResult.BestName(name); bool ok = Is.Ok(lhs, operation, rhs); Result result = new Result(ok, name, MyResult.BestText(name, text)); if (!ok) { result.Last.TestResult = statusIfFail; } MyResult += result; return(MyResult); } /// <summary>Performs a specified binary operation check</summary>