public void TileSerializesToJson() { Tile tile = new Tile(123, TileMovementFlags.BulletPassable | TileMovementFlags.Passable); string serialized = TileSerializer.Serialize(tile); string expected = "{\"MovementFlags\":5,\"Id\":123}"; Assert.That(serialized, Is.EqualTo(expected)); }
public ActionResult <string> GetTile([FromRoute] int id) { Tile tile = MasterGameController.TheGame.Tiles?.Find(t => t.Id == id); if (tile == null) { return(NotFound()); } return(TileSerializer.Serialize(tile)); }