示例#1
0
    public void ShouldGenerateLodestoneUrl(long id, string expectedUrl)
    {
        var characterBrief = new CharacterBrief()
        {
            Id = id
        };
        var details = new GetCharacterData();

        var result = CharacterResultEngine.Merge(characterBrief, details);

        Assert.Equal(expectedUrl, result.LodestoneUrl);
    }
    private async Task <Character> ProcessDetails(CharacterBrief character)
    {
        var query = new GetCharacterQuery()
        {
            Id   = character.Id,
            Data = "CJ,FC"
        };

        _logger.LogDebug("Getting details for {Name}. Id: {Id}.", character.Name, character.Id);

        var details = await _xivApiAccessor.GetCharacter(query);

        return(CharacterResultEngine.Merge(character, details));
    }
示例#3
0
    public void ShouldConvertTribe(Tribe?tribe, string?expectedTribe)
    {
        var characterBrief = new CharacterBrief();
        var details        = new GetCharacterData()
        {
            Character = new CharacterFull()
            {
                Tribe = tribe
            }
        };

        var result = CharacterResultEngine.Merge(characterBrief, details);

        Assert.Equal(expectedTribe, result.Tribe);
    }
示例#4
0
    public void ShouldConvertRace(Race?race, string?expectedRace)
    {
        var characterBrief = new CharacterBrief();
        var details        = new GetCharacterData()
        {
            Character = new CharacterFull()
            {
                Race = race
            }
        };

        var result = CharacterResultEngine.Merge(characterBrief, details);

        Assert.Equal(expectedRace, result.Race);
    }
示例#5
0
    public void ShouldRemoveDuplicates(string?input, string?expectedName)
    {
        var characterBrief = new CharacterBrief();
        var details        = new GetCharacterData()
        {
            Character = new CharacterFull()
            {
                ActiveClassJob = new ClassJob()
                {
                    Name = input
                }
            }
        };

        var result = CharacterResultEngine.Merge(characterBrief, details);

        Assert.Equal(expectedName, result.CurrentClassJob?.Name);
    }