Exemplo n.º 1
0
        internal static void CheckIAdrCodeGenerator(
            IAdrCodeGenerator expected, IAdrCodeGenerator actual, String message)
        {
            TestUtils.CheckType(expected, actual, message);

            Type expectedType = expected.GetType();

            if (expectedType == typeof(DecimalConstant))
            {
                DecimalConstantTest.Check(
                    (DecimalConstant)expected, (DecimalConstant)actual, message);
            }
            else if (expectedType == typeof(HexaDecimalConstant))
            {
                HexaDecimalConstantTest.Check(
                    (HexaDecimalConstant)expected, (HexaDecimalConstant)actual, message);
            }
            else if (expectedType == typeof(AddressConstant))
            {
                AddressConstantTest.Check(
                    (AddressConstant)expected, (AddressConstant)actual, message);
            }
            else if (expectedType == typeof(Literal))
            {
                LiteralTest.Check(
                    (Literal)expected, (Literal)actual, message);
            }
            else
            {
                Assert.Fail("未知の IAddrCodeGenerator の実装クラスです。");
            }
        }
Exemplo n.º 2
0
        internal static void Check(Constant expected, Constant actual, String message)
        {
            TestUtils.CheckType(expected, actual, message);

            Type expectedType = expected.GetType();

            if (expectedType == typeof(DecimalConstant))
            {
                DecimalConstantTest.Check(
                    (DecimalConstant)expected, (DecimalConstant)actual, message);
            }
            else if (expectedType == typeof(HexaDecimalConstant))
            {
                HexaDecimalConstantTest.Check(
                    (HexaDecimalConstant)expected, (HexaDecimalConstant)actual, message);
            }
            else if (expectedType == typeof(StringConstant))
            {
                StringConstantTest.Check(
                    (StringConstant)expected, (StringConstant)actual, message);
            }
            else if (expectedType == typeof(AddressConstant))
            {
                AddressConstantTest.Check(
                    (AddressConstant)expected, (AddressConstant)actual, message);
            }
            else
            {
                Assert.Fail("未知の Constant の派生クラスです。");
            }
        }