public void CreateFieldTileListTest() { var actual = testee.CreateTileList(10); Assert.All(actual, x => Assert.NotNull(x)); Assert.All(actual, x => Assert.Equal(typeof(BasicFieldTile), x.GetType())); Assert.NotEmpty(actual); Assert.Equal(10, actual.Count()); }
private FieldTile[][] CreateTilesetForMap(int qubeSize) { FieldTile[][] tiles = new FieldTile[qubeSize][]; for (int i = 0; i < qubeSize; i++) { tiles[i] = fieldTileFactoryMock.CreateTileList(qubeSize).ToArray(); } return(tiles); }
//TODO: Make gamefield observable for change public GameFieldTest() { placeableObjectMock = Substitute.For <PlaceableObject>(); fieldTileFactoryMock = Substitute.For <FieldTileFactory>(); tileMock = Substitute.For <FieldTile>(); FieldTile[] tiles = new FieldTile[fieldSize]; for (int i = 0; i < tiles.Length; i++) { tiles[i] = tileMock; } fieldTileFactoryMock.CreateTileList(fieldSize).Returns(tiles); testee = new ArrayTiledGameField(fieldSize, fieldTileFactoryMock); }