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

            Assert.IsType <ArgumentNullException>(result);
        }
Esempio n. 2
0
 private DeadState CreateSut()
 {
     return(new DeadState(new StateMemory(MockEliteAPI.AsMemoryApi())
     {
         Config = MockConfig,
         UnitFilters = new MockUnitFilters()
     }));
 }
Esempio n. 3
0
 public UnitFilterTests()
 {
     mob     = FindBasicMob();
     mockApi = new MockEliteAPI();
     api     = mockApi.AsMemoryApi();
     sut     = new UnitFilters();
     config  = FindConfig();
 }
 public AbstractTestBase()
 {
     MockConfig = new MockConfig {
         BattleLists = new BattleLists(Config.Instance.BattleLists)
     };
     MockEliteAPI = MockEliteAPI.Create();
     StartRecordingEvents();
 }
Esempio n. 5
0
 public TestContext()
 {
     Units = new List <IUnit> {
         new MockUnit()
     };
     Config  = new MockConfig();
     Player  = new MockPlayer();
     Target  = new NullUnit();
     MockAPI = new MockEliteAPI();
     API     = new MockEliteAPIAdapter(MockAPI);
     Memory  = new StateMemory(API);
 }
Esempio n. 6
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
            }
Esempio n. 7
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
        }
Esempio n. 8
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
            }
Esempio n. 9
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
            }
Esempio n. 10
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
            }
Esempio n. 11
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
            }
 private bool VerifySut(int recastTime = 0)
 {
     MockEliteAPI.Timer.RecastTime = recastTime;
     return(AbilityUtils.IsRecastable(MockEliteAPI.AsMemoryApi(), _ability));
 }
 public IMemoryAPI FindMemoryApi()
 {
     return(MockEliteAPI.AsMemoryApi());
 }