Esempio n. 1
0
        public static void ToIntTest(int value)
        {
            var instance = new DBValueInt(value);

            var intValue = instance.ToInt();

            // セットした値と取得した値が一致すること
            Assert.AreEqual(intValue, value);
        }
Esempio n. 2
0
        public static void ConstructorIntTest(int value, bool isError)
        {
            var errorOccured = false;

            try
            {
                var _ = new DBValueInt(value);
            }
            catch (Exception ex)
            {
                logger.Exception(ex);
                errorOccured = true;
            }

            // エラーフラグが一致すること
            Assert.AreEqual(errorOccured, isError);
        }
Esempio n. 3
0
        public static void CastFromDBValueIntTest(DBValueInt value)
        {
            DBItemValue instance = null;

            var errorOccured = false;

            try
            {
                instance = value;
            }
            catch (Exception ex)
            {
                logger.Exception(ex);
                errorOccured = true;
            }

            // エラーが発生しないこと
            Assert.IsFalse(errorOccured);

            // キャストした結果が一致すること
            Assert.AreEqual((DBValueInt)instance, value);
        }
Esempio n. 4
0
        public static void CastDBValueIntToIntTest(int value)
        {
            var castValue = 0;

            var instance = new DBValueInt(value);

            var errorOccured = false;

            try
            {
                castValue = instance;
            }
            catch (Exception ex)
            {
                logger.Exception(ex);
                errorOccured = true;
            }

            // エラーが発生しないこと
            Assert.IsFalse(errorOccured);

            // 元の値と一致すること
            Assert.AreEqual(castValue, value);
        }