public void Apply_NoEntityId_NoCreationTag() { var tc = new TagChange(new TagChangeData(GameTag.HEALTH, 5, false, null, null)); var game = new MockGameState(); tc.Apply(game); Assert.IsNull(tc.EntityId); Assert.IsNull(tc.PreviousValue); }
public void Apply_ValidEntity() { var tc = new TagChange(new TagChangeData(GameTag.HEALTH, 5, false, 1, null)); var game = new MockGameState(); game.Entities.Add(1, new Entity(1, "CARD_ID")); tc.Apply(game); Assert.AreEqual(0, tc.PreviousValue); Assert.AreEqual(tc.Value, game.Entities[tc.EntityId.Value].Tags[tc.Tag]); }
public void Apply_InvalidEntity() { var tc = new TagChange(new TagChangeData(GameTag.HEALTH, 5, false, 2, null)); var game = new MockGameState(); var entity = new Entity(1, "CARD_ID"); game.Entities.Add(1, entity); tc.Apply(game); Assert.IsNull(tc.PreviousValue); }
public void Apply_ValidEntity_ControllerChange() { var tc = new TagChange(new TagChangeData(GameTag.CONTROLLER, 1, false, 1, null)); var game = new MockGameState(); game.Entities.Add(1, new Entity(1, "CARD_ID")); tc.Apply(game); Assert.AreEqual(tc.Value, game.Entities[tc.EntityId.Value].Info.OriginalController); var tc2 = new TagChange(new TagChangeData(GameTag.CONTROLLER, 2, false, 1, null)); tc2.Apply(game); Assert.AreEqual(tc.Value, game.Entities[tc.EntityId.Value].Info.OriginalController); }
public void Apply_ValidEntity_ZoneChange() { var tc = new TagChange(new TagChangeData(GameTag.ZONE, (int)Zone.DECK, false, 1, null)); var game = new MockGameState { CurrentTurn = 1 }; game.Entities.Add(1, new Entity(1, "CARD_ID")); tc.Apply(game); Assert.AreEqual((Zone?)tc.Value, game.Entities[tc.EntityId.Value].Info.OriginalZone); Assert.AreEqual(Zone.INVALID, game.Entities[tc.EntityId.Value].Info.PreviousZone); Assert.AreEqual(1, game.Entities[tc.EntityId.Value].Info.LastZoneChange); var tc2 = new TagChange(new TagChangeData(GameTag.ZONE, (int)Zone.HAND, false, 1, null)); tc2.Apply(game); Assert.AreEqual((Zone?)tc.Value, game.Entities[tc.EntityId.Value].Info.OriginalZone); }