Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateFoodAction 구조 변경 #81

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions backend/app/Savor22b.Tests/Action/CancelFoodActionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ public class CancelFoodActionTests : ActionTests
var equipmentStateId1 = Guid.NewGuid();
var equipmentStateId2 = Guid.NewGuid();

var kitchenEquipmentState1 = new KitchenEquipmentState(equipmentStateId1, 1, 1, 1, 10);
var kitchenEquipmentState2 = new KitchenEquipmentState(equipmentStateId2, 2, 2, 1, 10);

var testFood = RefrigeratorState.CreateFood(
Guid.NewGuid(),
1,
Expand All @@ -35,13 +32,29 @@ public class CancelFoodActionTests : ActionTests
ImmutableList<Guid>.Empty.Add(equipmentStateId1).Add(equipmentStateId2)
);

var kitchenEquipmentState1 = new KitchenEquipmentState(
equipmentStateId1,
1,
1,
testFood.StateID,
1,
10
);
var kitchenEquipmentState2 = new KitchenEquipmentState(
equipmentStateId2,
2,
2,
testFood.StateID,
1,
10
);

InventoryState beforeInventoryState = new InventoryState();
beforeInventoryState = beforeInventoryState.AddRefrigeratorItem(testFood);
beforeInventoryState = beforeInventoryState.AddKitchenEquipmentItem(kitchenEquipmentState1);
beforeInventoryState = beforeInventoryState.AddKitchenEquipmentItem(kitchenEquipmentState2);

KitchenState beforeKitchenState = new KitchenState();
beforeKitchenState.InstallKitchenEquipment(kitchenEquipmentState2, 1);

RootState beforeRootState = new RootState(
beforeInventoryState,
Expand Down Expand Up @@ -90,15 +103,12 @@ public void Execute_Success_Normal()
.GetKitchenEquipmentState(kitchenEquipmentState1.StateID)!
.IsInUse(blockIndex)
);

Assert.NotNull(
afterRootState.VillageState!.HouseState.KitchenState
.GetApplianceSpaceStateByNumber(1)
.InstalledKitchenEquipmentStateId
afterRootState.InventoryState.GetKitchenEquipmentState(kitchenEquipmentState2.StateID)
);
Assert.False(
afterRootState.VillageState!.HouseState.KitchenState
.GetApplianceSpaceStateByNumber(1)
afterRootState.InventoryState
.GetKitchenEquipmentState(kitchenEquipmentState2.StateID)!
.IsInUse(blockIndex)
);
}
Expand Down
Loading
Loading