Address code review changes and add XML comments

This commit is contained in:
Haacked
2013-10-10 14:22:09 -07:00
parent 33ad79c0fe
commit ae41b81025
13 changed files with 393 additions and 132 deletions

View File

@@ -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();
}
}
*/
}