mirror of
https://github.com/zoriya/octokit.net.git
synced 2025-12-22 23:25:24 +00:00
Address code review changes and add XML comments
This commit is contained in:
@@ -33,43 +33,4 @@ namespace Octokit
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
[Fact]
|
||||
public void CreatesGitHubErrorFromJsonResponse()
|
||||
{
|
||||
var exception = new ApiUnauthorizedWebException("{\"message\":\"Bad credentials.\"}");
|
||||
|
||||
exception.ApiUnauthorizedError.Message.ShouldEqual("Bad credentials.");
|
||||
exception.ApiUnauthorizedError.Errors.ShouldBeNull();
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("")]
|
||||
[InlineData(null)]
|
||||
[InlineData("{{{{{")]
|
||||
public void CreatesGitHubErrorIfResponseMessageIsNotValidJson(string responseContent)
|
||||
{
|
||||
var exception = new ApiUnauthorizedWebException(responseContent);
|
||||
|
||||
exception.ApiUnauthorizedError.Message.ShouldEqual(responseContent);
|
||||
Assert.False(exception.RequiresSecondFactor);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CanPopulateObjectFromSerializedData()
|
||||
{
|
||||
var exception = new ApiUnauthorizedWebException("{message:\"Bad credentials.\"}");
|
||||
using (var stream = new MemoryStream())
|
||||
{
|
||||
var formatter = new BinaryFormatter();
|
||||
formatter.Serialize(stream, exception);
|
||||
stream.Position = 0;
|
||||
var deserialized = (ApiUnauthorizedWebException)formatter.Deserialize(stream);
|
||||
deserialized.ApiUnauthorizedError.Message.ShouldEqual("Bad credentials.");
|
||||
exception.ApiUnauthorizedError.Errors.ShouldBeNull();
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
Reference in New Issue
Block a user