public static void GetMinCapacityTest() { var instance = new EventCommandShortCutKeyList(); var maxCapacity = instance.GetMinCapacity(); // 取得した値が容量最大値と一致すること Assert.AreEqual(maxCapacity, EventCommandShortCutKeyList.MinCapacity); }
public static void SerializeTest() { var target = new EventCommandShortCutKeyList { [2] = EventCommandShortCutKey.Eight, }; var clone = DeepCloner.DeepClone(target); Assert.IsTrue(clone.Equals(target)); }
/** ======================================== * EditorIniオブジェクト作成 * ======================================== */ public static EditorIniData GenerateData0() { return(new EditorIniData { StartFlag = 0, LastLoadFile = "MapData/Map000.mps", MainWindowPosition = (0, 0), MainWindowSize = (651, 322), MapChipWindowPosition = (0, 0), MapEventWindowPosition = (273, 230), MapEventWindowSize = (840, 410), MapEventInputWindowPosition = (0, 0), CommonEventWindowPosition = (0, 0), CommonEventWindowSize = (800, 640), CommonEventInputWindowPosition = (0, 0), UserDbWindowPosition = (27, 54), ChangeableDbWindowPosition = (27, 54), SystemDbWindowPosition = (27, 54), DatabaseValueNumberDrawType = DatabaseValueNumberDrawType.FromCode("0"), EditTimeDrawType = EditTimeDrawType.On, EditTime = 14, NotEditTime = 0, IsShowDebugWindow = true, LayerTransparent = LaterTransparentType.FromCode("2"), EventLayerOpacity = EventLayerOpacityType.FromCode("1"), CommandColorType = CommandColorType.FromCode("0"), IsDrawBackgroundImage = true, NotCopyExtList = new ExtensionList(new Extension[] { ".psd", ".sai", ".svg", ".xls", ".db", ".tmp", ".bak", ".db", "dummy_file" }), CommandViewType = 0, BackupType = ProjectBackupType.FromCode("3"), ShortCutKeyList = new EventCommandShortCutKeyList(new[] { EventCommandShortCutKey.One, EventCommandShortCutKey.Two, EventCommandShortCutKey.Three, EventCommandShortCutKey.Four, EventCommandShortCutKey.Five, EventCommandShortCutKey.Six, EventCommandShortCutKey.Seven, EventCommandShortCutKey.Eight, EventCommandShortCutKey.Nine, EventCommandShortCutKey.A, EventCommandShortCutKey.B, EventCommandShortCutKey.C, EventCommandShortCutKey.D, EventCommandShortCutKey.E, EventCommandShortCutKey.F, EventCommandShortCutKey.G, EventCommandShortCutKey.H, EventCommandShortCutKey.I, EventCommandShortCutKey.J, EventCommandShortCutKey.One, EventCommandShortCutKey.One, EventCommandShortCutKey.One, EventCommandShortCutKey.One, EventCommandShortCutKey.One, EventCommandShortCutKey.One, EventCommandShortCutKey.One, EventCommandShortCutKey.One, EventCommandShortCutKey.One, EventCommandShortCutKey.One, EventCommandShortCutKey.One, }), CommandPositionList = new ShortCutPositionList(new ShortCutPosition[] { 1, 0, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1, 17, 18, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, }), IsUseExpertCommand = false, });
public static void Validate(string testItemCode, bool answer) { var instance = new EventCommandShortCutKeyList(); switch (testItemCode) { case "Success": // 初期状態 = 正常な状態 break; case "DuplicateShortCutKeyList": instance[0] = EventCommandShortCutKey.A; instance[1] = EventCommandShortCutKey.A; break; case "SetValueNotUseShortCutKeyList": instance[19] = EventCommandShortCutKey.A; break; default: Assert.Fail(); break; } var result = instance.Validate(out var errorMsg); // 結果が意図した値と一致すること Assert.AreEqual(result, answer); // チェックOKの場合は以降のテスト不要 if (result) { return; } // エラーメッセージが格納されていること Assert.IsNotEmpty(errorMsg); logger.Debug(errorMsg); }