Merge pull request #140 from klinge/feature/128-ArtistGetInfo-add-lang-param

Issue 128 - Added lang param to Artist.GetInfo
This commit is contained in:
Rikki Tooley 2019-01-20 16:33:49 +00:00 committed by GitHub
commit e2511d19a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 1 deletions

View File

@ -125,6 +125,23 @@ public async Task HandleSuccessResponse()
Assert.AreEqual(expectedJson, actualJson, expectedJson.DifferencesTo(actualJson));
}
[Test]
public void ArtistGetInfo_SetLangParam_Success()
{
GetInfoCommand _command2 = new GetInfoCommand(MAuth.Object)
{
ArtistName = "Frightened Rabbit",
BioLanguage = "fr"
};
//call the commands SetParameter method - this is ususally done in Command.ExecuteAsync
_command2.SetParameters();
string langValue;
Assert.IsTrue(_command2.Parameters.TryGetValue("lang", out langValue));
Assert.AreEqual("fr", langValue);
}
[Test]
public async Task HandleErrorResponse()

View File

@ -35,7 +35,12 @@ public override void SetParameters()
{
Parameters.Add("artist", ArtistName);
}
if (BioLanguage != null)
{
Parameters.Add("lang", BioLanguage);
}
Parameters.Add("autocorrect", Convert.ToInt32(Autocorrect).ToString());
DisableCaching();