Skip to content

Commit

Permalink
#147 test: ユニットテストを改修
Browse files Browse the repository at this point in the history
  • Loading branch information
ienaga committed Jul 19, 2024
1 parent 9b08465 commit 96cc389
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ import {
$STAGE_HEIGHT_COMMAND,
$STAGE_FPS_COMMAND,
$STAGE_COLOR_COMMAND,
$CHARACTER_UPDATE_X,
$CHARACTER_UPDATE_Y,
$CHARACTER_UPDATE_X_COMMAND,
$CHARACTER_UPDATE_Y_COMMAND,
$LIBRARY_ADD_NEW_SHAPE_COMMAND,
$LIBRARY_UPDATE_SHAPE_GRAPHICS_COMMAND
} from "../../../../config/HistoryConfig";
Expand Down Expand Up @@ -104,8 +104,8 @@ describe("HistoryGetTextServiceTest", () =>
expect(execute($STAGE_HEIGHT_COMMAND)).toBe("ステージの高さを%s1から%s2に変更");
expect(execute($STAGE_FPS_COMMAND)).toBe("ステージのFPSを%s1から%s2に変更");
expect(execute($STAGE_COLOR_COMMAND)).toBe("ステージの背景色を「%s1」から「%s2」に変更");
expect(execute($CHARACTER_UPDATE_X)).toBe("「%s1」のレイヤー「%s2」の%s3フレーム・深度%s4のx座標を%s5から%s6に変更");
expect(execute($CHARACTER_UPDATE_Y)).toBe("「%s1」のレイヤー「%s2」の%s3フレーム・深度%s4のy座標を%s5から%s6に変更");
expect(execute($CHARACTER_UPDATE_X_COMMAND)).toBe("「%s1」のレイヤー「%s2」の%s3フレーム・深度%s4のx座標を%s5から%s6に変更");
expect(execute($CHARACTER_UPDATE_Y_COMMAND)).toBe("「%s1」のレイヤー「%s2」の%s3フレーム・深度%s4のy座標を%s5から%s6に変更");
expect(execute($LIBRARY_ADD_NEW_SHAPE_COMMAND)).toBe("新規Shape「%s1」を追加");
expect(execute($LIBRARY_UPDATE_SHAPE_GRAPHICS_COMMAND)).toBe("「%s1」のグラフィックを変更");
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { execute } from "./CharacterUpdateXCreateHistoryObjectService";
import { $CHARACTER_UPDATE_X } from "../../../../../../../config/HistoryConfig";
import { $CHARACTER_UPDATE_X_COMMAND } from "../../../../../../../config/HistoryConfig";
import { MovieClip } from "../../../../../../../core/domain/model/MovieClip";
import { Character } from "../../../../../../../core/domain/model/Character";

Expand All @@ -19,7 +19,7 @@ describe("CharacterUpdateXCreateHistoryObjectServiceTest", () =>
layer.name = "test_layer";

const object = execute(1, movieClip, layer, character, 10);
expect(object.command).toBe($CHARACTER_UPDATE_X);
expect(object.command).toBe($CHARACTER_UPDATE_X_COMMAND);

// 配列の順番が崩れてもいいようにテストケースを残す
expect(object.messages.length).toBe(7);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { execute } from "./CharacterUpdateYCreateHistoryObjectService";
import { $CHARACTER_UPDATE_Y } from "../../../../../../../config/HistoryConfig";
import { $CHARACTER_UPDATE_Y_COMMAND } from "../../../../../../../config/HistoryConfig";
import { MovieClip } from "../../../../../../../core/domain/model/MovieClip";
import { Character } from "../../../../../../../core/domain/model/Character";

Expand All @@ -19,7 +19,7 @@ describe("CharacterUpdateYCreateHistoryObjectServiceTest", () =>
layer.name = "test_layer";

const object = execute(1, movieClip, layer, character, 10);
expect(object.command).toBe($CHARACTER_UPDATE_Y);
expect(object.command).toBe($CHARACTER_UPDATE_Y_COMMAND);

// 配列の順番が崩れてもいいようにテストケースを残す
expect(object.messages.length).toBe(7);
Expand Down

0 comments on commit 96cc389

Please sign in to comment.