/** ========================================
         *  GameIniオブジェクト作成
         *  ======================================== */

        public static GameIniData GenerateData0()
        {
            return(new GameIniData
            {
                StartCode = 0,
                IsSoftGraphicMode = false,
                IsWindowMode = true,
                IsPlayBgm = true,
                IsPlaySe = true,
                FrameSkipType = FrameSkipType.FromCode("0"),
                ProxyAddress = "2001:a453:69:1111:54ff:15:1111:2222",
                ProxyPort = -1,
                CanTakeScreenShot = true,
                CanReset = true,
                DisplayNumber = 0,
                IsUseOldDirectX = false,
            });
        }
Beispiel #2
0
        public static void FrameSkipTypeTest(FrameSkipType type, bool isError)
        {
            var instance            = new GameIniData();
            var changedPropertyList = new List <string>();

            instance.PropertyChanged += (sender, args) => { changedPropertyList.Add(args.PropertyName); };


            var errorOccured = false;

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

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

            if (!errorOccured)
            {
                var setValue = instance.FrameSkipType;

                // セットした値と取得した値が一致すること
                Assert.IsTrue(setValue.Equals(type));
            }

            // 意図したとおりプロパティ変更通知が発火していること
            if (errorOccured)
            {
                Assert.AreEqual(changedPropertyList.Count, 0);
            }
            else
            {
                Assert.AreEqual(changedPropertyList.Count, 1);
                Assert.IsTrue(changedPropertyList[0].Equals(nameof(GameIniData.FrameSkipType)));
            }
        }