public void Delete_Goat_Test()
        {
            // arrange
            List <Goat> goats = new List <Goat>();
            var         goat  = new Goat()
            {
                GoatName = "Molly Mea", ID = 1
            };

            goats.Add(goat);
            const string NAME = "Maggie Sue";

            goat = new Goat()
            {
                GoatName = NAME, ID = 2
            };
            goats.Add(goat);

            var target = new GoatController(new FakeGoatRepository(goats));

            // act
            target.DeleteConfirmed(2);

            // assert
            Assert.AreEqual(1, goats.Count);
            Assert.AreNotEqual(NAME, goats[0].GoatName);
        }
 public JumpState(GoatController controller) : base(controller)
 {
     AvailableTransitions = new List <GoatState> {
         GoatState.Run,
         GoatState.Die,
         GoatState.Obstacle,
         GoatState.SlowDown,
         GoatState.Yell,
     };
     Type = GoatState.Jump;
 }
Exemplo n.º 3
0
        public void List_getWith2Users_ShouldReturnViewWith2Users()
        {
            // Arrange
            var goatController = new GoatController(userRepo);

            // Act
            var userModel = goatController.List().Model as List <User>;

            // Assert
            Assert.That(userModel.Count(), Is.EqualTo(2));
        }
 public YellState(GoatController controller) : base(controller)
 {
     AvailableTransitions = new List <GoatState> {
         GoatState.Run,
         GoatState.Die,
         GoatState.Obstacle,
         GoatState.Jump,
     };
     Type       = GoatState.Yell;
     TimeToExit = 0.8f;
     ExitState  = GoatState.Run;
 }
    void Start()
    {
        _lc   = LocalizationController.Instance;
        _goat = GameState.Instance.Goat;
        var ls = LevelSettings.Instance;

        if (!ls.Endless)
        {
            gameObject.SetActive(false);
            return;
        }
    }
 public SlowDownState(GoatController controller) : base(controller)
 {
     AvailableTransitions = new List <GoatState> {
         GoatState.Run,
         GoatState.Die,
         GoatState.Obstacle,
         GoatState.Jump,
         GoatState.Yell
     };
     Type       = GoatState.SlowDown;
     TimeToExit = 1f;
     ExitState  = GoatState.Run;
 }
        public void Create_Goat_Test()
        {
            // arrange
            List <Goat> goats  = new List <Goat>();
            var         target = new GoatController(new FakeGoatRepository(goats));

            // act
            const string NAME = "Molly Mea";
            var          goat = new Goat()
            {
                GoatName = NAME
            };

            target.Create(goat);

            // assert
            Assert.AreEqual(NAME, goats[0].GoatName);
        }
 public DeadState(GoatController controller) : base(controller)
 {
     AvailableTransitions = new List <GoatState>();
     Type = GoatState.Die;
 }
 public State(GoatController controller)
 {
     EnterTime  = GameState.Instance.TimeController.CurrentTime;
     Controller = controller;
 }
 public SlowDownState(GoatController controller, float slowdownTime) : this(controller) {
     TimeToExit = slowdownTime;
 }