public void MediaServicesCredentialsTestReuseInvalidToken()
{
var context1 = WindowsAzureMediaServicesTestConfiguration.CreateCloudMediaContext();
//Make call to get endpoint and valid token
MakeRestCallAndVerifyToken(context1);
MediaServicesCredentials credentials = context1.Credentials;
credentials.AccessToken = "Invalid";
try
{
var context2 = WindowsAzureMediaServicesTestConfiguration.CreateCloudMediaContext(credentials);
MakeRestCallAndVerifyToken(context2);
}
catch (DataServiceQueryException x)
{
var code = x.Response.StatusCode;
Assert.AreEqual((int)HttpStatusCode.Unauthorized, code);
throw;
}
}