private void UpdateStatus()
 {
     _status.PrintLevel(_level);
     _status.PrintRobots(Robots.Count());
     _status.PrintScore(_score);
     _status.PrintTeleports(_player.Teleports);
 }
Exemple #2
0
        public void ShouldFetchCount()
        {
            var getRobotCountExpectation = A.CallTo(() => Shopify.CallRaw(HttpMethod.Get,
                                                                          JsonFormatExpectation(),
                                                                          "/admin/robots/count", EmptyQueryParametersExpectation(), null));

            getRobotCountExpectation.Returns(TaskForResult <string>("robots count json"));

            var translationExpectation = A.CallTo(() => Shopify.TranslateObject <int>("count", "robots count json"));

            translationExpectation.Returns(34969);
            var answer = Robots.Count();

            answer.Wait();

            Assert.AreEqual(34969, answer.Result);
        }
Exemple #3
0
 public Mediator(List <IRobot> robots)
 {
     Robots = robots.Select(r => new Robot
     {
         Health = 100,
         RobotImplementation = r,
         Id       = Guid.NewGuid(),
         LastTurn = DateTime.Now,
         Name     = r.GetName()
     }).ToList();
     Robots.ForEach(r =>
     {
         if (Robots.Count(b => b.Name == r.Name) > 1)
         {
             throw new Exception("Duplicate robots exist.");
         }
     });
     RandomizeStartOrder();
 }