Exemplo n.º 1
0
        public void UseBuffingActionsWithNullActionListThrows()
        {
            Executor  sut    = new Executor(MockEliteAPI.AsMemoryApi());
            Exception result = Record.Exception(() => sut.UseBuffingActions(null));

            Assert.IsType <ArgumentNullException>(result);
        }
Exemplo n.º 2
0
 private DeadState CreateSut()
 {
     return(new DeadState(new StateMemory(MockEliteAPI.AsMemoryApi())
     {
         Config = MockConfig,
         UnitFilters = new MockUnitFilters()
     }));
 }
Exemplo n.º 3
0
 public UnitFilterTests()
 {
     mob     = FindBasicMob();
     mockApi = new MockEliteAPI();
     api     = mockApi.AsMemoryApi();
     sut     = new UnitFilters();
     config  = FindConfig();
 }
Exemplo n.º 4
0
 /// <summary>
 /// Create new state memory with <see cref="MockEliteAPI"/> and <see cref="MockConfig"/>.
 /// </summary>
 /// <returns></returns>
 public StateMemory CreateStateMemory(bool targetValid = true)
 {
     return(new StateMemory(MockEliteAPI.AsMemoryApi())
     {
         Config = MockConfig,
         UnitFilters = new MockUnitFilters()
         {
             Result = targetValid
         }
     });
 }
Exemplo n.º 5
0
            public void RunOnZoningStopsPlayerFromRunning()
            {
                // Fixture setup
                var sut = CreateSut(new StateMemory(MockEliteAPI.AsMemoryApi())
                {
                    Config      = MockConfig,
                    UnitFilters = new MockUnitFilters()
                }, zoningAction: ForceMoveToNextZone);

                MockEliteAPI.Player.Zone = NewZone;
                // Exercise system
                sut.Run();
                // Verify outcome
                Assert.False(MockEliteAPI.Navigator.IsRunning);
                // Teardown
            }
Exemplo n.º 6
0
        /// <summary>
        /// Ignoring test since it will always hang right now.
        ///
        /// Ensure cast does not seem to proceed, and will loop indefintiely.
        /// </summary>
        public void UseBuffingActionsWillUseAbilityNameToCastCommand()
        {
            // Fixture setup
            BattleAbility battleAbility = FindAbility();

            battleAbility.Name        = "test";
            battleAbility.AbilityType = AbilityType.Magic;
            Executor sut = new Executor(MockEliteAPI.AsMemoryApi());

            // Exercise system
            sut.UseBuffingActions(new List <BattleAbility> {
                battleAbility
            });
            // Verify outcome
            Assert.Equal("/magic test <t>", MockEliteAPI.Windower.LastCommand);
            // Teardown
        }
Exemplo n.º 7
0
            public void CheckIsTrueWhenPlayersStatsAreZero()
            {
                // Fixture setup
                MockEliteAPI.Player.Stats = new Structures.PlayerStats()
                {
                    Str = 0
                };
                var sut = CreateSut(new StateMemory(MockEliteAPI.AsMemoryApi())
                {
                    Config      = MockConfig,
                    UnitFilters = new MockUnitFilters()
                });
                // Exercise system
                var result = sut.Check();

                // Verify outcome
                Assert.True(result);
                // Teardown
            }
Exemplo n.º 8
0
            public void CheckIsFalseWhenNotZoning()
            {
                // Fixture setup
                MockEliteAPI.Player.Zone  = StartingZone;
                MockEliteAPI.Player.Stats = new Structures.PlayerStats()
                {
                    Str = 100
                };
                var sut = CreateSut(new StateMemory(MockEliteAPI.AsMemoryApi())
                {
                    Config      = MockConfig,
                    UnitFilters = new MockUnitFilters()
                });
                // Exercise system
                var result = sut.Check();

                // Verify outcome
                Assert.False(result);
                // Teardown
            }
Exemplo n.º 9
0
            public void RunWhileZoningWaits()
            {
                // Fixture setup
                MockEliteAPI.Player.Zone  = StartingZone;
                MockEliteAPI.Player.Stats = new Structures.PlayerStats()
                {
                    Str = 0
                };
                var sut = CreateSut(new StateMemory(MockEliteAPI.AsMemoryApi())
                {
                    Config      = MockConfig,
                    UnitFilters = new MockUnitFilters()
                }, zoningAction: ForceMoveToNextZone);

                MockEliteAPI.Player.Zone = NewZone;
                // Exercise system
                sut.Run();
                // Verify outcome
                Assert.Equal(100, MockEliteAPI.Player.Stats.Str);
                // Teardown
            }
Exemplo n.º 10
0
            public void RunOnZoningSetsZoneToNewZone()
            {
                // Fixture setup
                MockEliteAPI.Player.Zone  = StartingZone;
                MockEliteAPI.Player.Stats = new Structures.PlayerStats()
                {
                    Str = 100
                };
                var sut = CreateSut(new StateMemory(MockEliteAPI.AsMemoryApi())
                {
                    Config      = MockConfig,
                    UnitFilters = new MockUnitFilters()
                });

                MockEliteAPI.Player.Zone = NewZone;
                // Exercise system
                sut.Run();
                // Verify outcome
                Assert.Equal(NewZone, sut.Zone);
                // Teardown
            }
Exemplo n.º 11
0
 private bool VerifySut(int recastTime = 0)
 {
     MockEliteAPI.Timer.RecastTime = recastTime;
     return(AbilityUtils.IsRecastable(MockEliteAPI.AsMemoryApi(), _ability));
 }
Exemplo n.º 12
0
 public IMemoryAPI FindMemoryApi()
 {
     return(MockEliteAPI.AsMemoryApi());
 }