Esempio n. 1
0
    private void SetupScenarioForTwoZombies(out GameObject zombie1, out GameObject zombie2)
    {
        // Initially, the logs should be empty.
        CombatLog.Should().BeEmpty();
        ActionLog.Should().BeEmpty();

        zombie1 = GameSystems.MapObject.CreateObject(TestProtos.Zombie, new locXY(500, 483));
        GameSystems.Critter.GenerateHp(zombie1);
        zombie2 = GameSystems.MapObject.CreateObject(TestProtos.Zombie, new locXY(500, 484));
        GameSystems.Critter.GenerateHp(zombie2);

        // Ensure a specific turn order
        SetInitiative(_player, 20);
        SetInitiative(zombie1, 10);
        SetInitiative(zombie2, 0);

        Game.RunUntil(() => GameSystems.Combat.IsCombatActive());

        GameSystems.Combat.IsCombatActive().Should().BeTrue();
        GameSystems.D20.Initiative.CurrentActor.Should().Be(_player);
        GameSystems.D20.Initiative.Should().Equal(
            _player,
            zombie1,
            zombie2
            );

        // Without advancing time, no combat history entries should exist
        CombatLog.Should().BeEmpty();
        ActionLog.Should().BeEmpty();

        // End turn for the player
        GameSystems.Combat.AdvanceTurn(_player);

        GameSystems.Combat.IsCombatActive().Should().BeTrue();
    }
Esempio n. 2
0
            public async Task should_return_valid_log_on_save()
            {
                ActionLog log = await _actionLogsService.SetUserActionAsync(TestData.Users.TestUser1Id, 1, (int)ActionTypes.AvailableStation);

                log.Should().NotBeNull();
                log.ActionTypeId.Should().Be(4);
                log.DepartmentId.Should().Be(1);
                log.UserId.Should().Be(TestData.Users.TestUser1Id);
            }