public static void SerializeTest() { var target = new ConditionRight(30); var clone = DeepCloner.DeepClone(target); Assert.IsTrue(clone.Equals(target)); }
public static void ConstructorTest(int value, bool isError) { var errorOccured = false; try { var _ = new ConditionRight(value); } catch (Exception ex) { logger.Exception(ex); errorOccured = true; } // エラーフラグが一致すること Assert.AreEqual(errorOccured, isError); }
public static void CastToIntTest(int value) { var instance = new ConditionRight(value); var errorOccured = false; try { var _ = (int)instance; } catch (Exception ex) { logger.Exception(ex); errorOccured = true; } // エラーが発生しないこと Assert.IsFalse(errorOccured); // キャストした結果が一致すること Assert.AreEqual((int)instance, value); }
public override bool Evaluate() => ConditionLeft.Evaluate() || ConditionRight.Evaluate();