public void PublishCard_Should_RaiseExceptionIfTokenSignedByWrongKey() { var identity = faker.Random.AlphaNumeric(15); var jwt = JwtSignedByWrongApiKey(identity); var client = new CardClient(AppSettings.CardsServiceAddress); Assert.ThrowsAsync <ClientException>( async() => await client.PublishCardAsync(GenerateRawSignedModel(identity), jwt.ToString())); }
public void PublishCard_Should_RaiseExceptionIfTokenIdentityDiffersFromModelIdentity() { var jwt = GenerateJwt( faker.Random.AlphaNumeric(15), (PrivateKey)IntegrationHelper.ApiPrivateKey(), AppSettings.ApiPublicKeyId ); var client = new CardClient(AppSettings.CardsServiceAddress); Assert.ThrowsAsync <ClientException>( async() => await client.PublishCardAsync( GenerateRawSignedModel(faker.Random.AlphaNumeric(15)), jwt.ToString()) ); }