public void UseBuffingActionsWithNullActionListThrows() { Executor sut = new Executor(MockEliteAPI.AsMemoryApi()); Exception result = Record.Exception(() => sut.UseBuffingActions(null)); Assert.IsType <ArgumentNullException>(result); }
private DeadState CreateSut() { return(new DeadState(new StateMemory(MockEliteAPI.AsMemoryApi()) { Config = MockConfig, UnitFilters = new MockUnitFilters() })); }
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(); }
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); }
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 }
/// <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 }
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 }
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 }
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 }
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()); }