Пример #1
0
        public static void SerializeTest()
        {
            var target = new ConditionRight(30);
            var clone  = DeepCloner.DeepClone(target);

            Assert.IsTrue(clone.Equals(target));
        }
Пример #2
0
        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);
        }
Пример #3
0
        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);
        }
Пример #4
0
 public override bool Evaluate() => ConditionLeft.Evaluate() || ConditionRight.Evaluate();