Пример #1
0
 public void FillWithAnimals_CannotFillNullBoaardWithAnimals_Exception() {
     var gameplay = new Gameplay {
         Animals = new List<IAnimal>()
     };
     AddAnimals(gameplay);
     Assert.Throws<NullReferenceException>(() => board.FillWithAnimals(gameplay.Animals));
 }
Пример #2
0
 public void Show(Gameplay gameplay) {
     Console.Write("L - add lion  ");
     Console.WriteLine("A - add antilope");
     Console.Write("Press any other key to resume...");
     SelectAction(Console.ReadKey(true).Key, gameplay);
     Console.WriteLine();
 }
Пример #3
0
 public void Setup() {
     lion = new Lion();
     lionActions = new LionActions();
     gameplay = new Gameplay {
         Animals = new List<IAnimal>()
     };
 }
Пример #4
0
 public void SetUp() {
     gameplay = new Gameplay {
         Animals = new List<IAnimal>()
     };
     animalActions= new AnimalActions();
     board = new Board();
     board.Create();
 }
Пример #5
0
 public void SetUp() {
     antilope = new Antilope();
     antilopeActions = new AntilopeActions();
     gameplay = new Gameplay {
         Animals = new List<IAnimal>()
     };
     board = new Board();
     board.Create();
 }
Пример #6
0
 private void SelectAction(ConsoleKey key, Gameplay gameplay) {
     switch (key) {
         case ConsoleKey.L:
             animalActions.AddAnimal(new Lion(), gameplay.Animals);
             break;
         case ConsoleKey.A:
             animalActions.AddAnimal(new Antilope(), gameplay.Animals);
             break;
     }
 }
Пример #7
0
 public void FillWithAnimals_CanFillBoad_Can() {
     var gameplay = new Gameplay {
         Animals = new List<IAnimal>()
     };
     AddAnimals(gameplay);
     board.Layout = new char[10, 10];
     var emptyField = new char[10, 10];
     board.FillWithAnimals(gameplay.Animals);
     Assert.AreNotEqual(emptyField, board.Layout);
 }
Пример #8
0
 public void Clear_ClearsBoardFormAnimals_ClearBoard() {
     board.Create();
     var gameplay = new Gameplay {
         Animals = new List<IAnimal>()
     };
     AddAnimals(gameplay);
     board.FillWithAnimals(gameplay.Animals);
     object filledBoard = board.Layout.Clone();
     board.Clear(gameplay.Animals);
     Assert.AreNotEqual(filledBoard, board.Layout);
 }
Пример #9
0
 public void SetUp() {
     gameplay = new Gameplay {
         Animals = new List<IAnimal>()
     };
 }
Пример #10
0
 private void AddAnimals(Gameplay gameplay) {
     AnimalActions animalActions = new AnimalActions();
     animalActions.AddAnimal(new Antilope(), gameplay.Animals);
     animalActions.AddAnimal(new Antilope(), gameplay.Animals);
 }
Пример #11
0
 private Gameplay InitializeAllNecessaryForOutOfBounds() {
     board.Create();
     var gameplay = new Gameplay {
         Animals = new List<IAnimal>()
     };
     gameplay.Animals.Add(new Antilope());
     return gameplay;
 }
Пример #12
0
 public void FillWithAnimals_CannotFillBoardWithNoAnimals_Exception() {
     var gameplay = new Gameplay();
     board.Layout = new char[5, 5];
     Assert.Throws<NullReferenceException>(() => board.FillWithAnimals(gameplay.Animals));
 }
Пример #13
0
 private static void Main() {
     var g = new Gameplay();
     g.NewGame();
 }