public void SetUp() { view = Substitute.For <BoardView>(); piecePlacedSignal = Substitute.For <PiecePlacedSignal>(); initializeBoardSignal = Substitute.For <InitializeBoardSignal>(); System.Random r = new System.Random(); position = new GridCellKey(r.Next(8), r.Next(8)); faction = r.NextDouble() > .5 ? Faction.Black : Faction.White; go = GameObject.CreatePrimitive(PrimitiveType.Cube); _instance = go.AddComponent <BoardViewMediator>(); _instance.View = view; _instance.PiecePlaced = piecePlacedSignal; _instance.InitializeBoard = initializeBoardSignal; }
public void TearDown() { _instance = null; GameObject.DestroyImmediate(go); }