예제 #1
0
        public static void ConstructorTestB(int initLength, bool hasNullItem, bool isError)
        {
            var             initItemList = MakeInitList(initLength, hasNullItem);
            CommonEventList instance     = null;

            var errorOccured = false;

            try
            {
                instance = new CommonEventList(initItemList);
            }
            catch (Exception ex)
            {
                logger.Exception(ex);
                errorOccured = true;
            }

            // エラーフラグが一致すること
            Assert.AreEqual(errorOccured, isError);

            if (errorOccured)
            {
                return;
            }

            // 選択肢が意図した数であること
            var answerResultLength = initLength != -1
                ? initLength
                : 0;

            Assert.AreEqual(instance.Count, answerResultLength);
        }
예제 #2
0
        public static void SerializeTest()
        {
            var target = new CommonEventList(MakeInitList(3, false));
            var clone  = DeepCloner.DeepClone(target);

            Assert.IsTrue(clone.Equals(target));
        }
예제 #3
0
        public static void GetMinCapacityTest()
        {
            var instance    = new CommonEventList();
            var maxCapacity = instance.GetMinCapacity();

            // 取得した値が容量最大値と一致すること
            Assert.AreEqual(maxCapacity, CommonEventList.MinCapacity);
        }
예제 #4
0
        public static void ConstructorTestA()
        {
            CommonEventList instance = null;

            var errorOccured = false;

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

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

            // 件数が1件であること
            Assert.AreEqual(instance.Count, 1);
        }
        // _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
        //     Constructor
        // _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/

        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="commonEventList">[NotNull] イベントコマンドリスト</param>
        /// <param name="changeableDatabase">[NotNull] 可変DB</param>
        /// <param name="userDatabase">[NotNull] ユーザDB</param>
        /// <param name="systemDatabase">[NotNull] システムDB</param>
        /// <param name="mapData">[Nullable] マップデータ</param>
        public EventCommandSentenceResolver(CommonEventList commonEventList,
                                            DatabaseMergedData changeableDatabase,
                                            DatabaseMergedData userDatabase, DatabaseMergedData systemDatabase,
                                            MapData mapData)
        {
            CommonEventList = commonEventList ??
                              throw new ArgumentNullException(ErrorMessage.NotNull(nameof(commonEventList)));
            ChangeableDatabase = changeableDatabase ??
                                 throw new ArgumentNullException(ErrorMessage.NotNull(nameof(changeableDatabase)));
            UserDatabase = userDatabase ??
                           throw new ArgumentNullException(ErrorMessage.NotNull(nameof(userDatabase)));
            SystemDatabase = systemDatabase ??
                             throw new ArgumentNullException(ErrorMessage.NotNull(nameof(systemDatabase)));
            MapData = mapData;

            CommonEvent     = new EventCommandSentenceResolver_CommonEvent(this);
            DatabaseBasic   = new EventCommandSentenceResolver_Database_Basic(this);
            DatabaseSpecial = new EventCommandSentenceResolver_Database_Special(this);
            MapEvent        = new EventCommandSentenceResolver_MapEvent(this);
            Variable        = new EventCommandSentenceResolver_Variable(this);
            VariableAddress = new EventCommandSentenceResolver_VariableAddress(this);
        }