Tested out all of the existing Pull Request code

Still missing integration tests for Pull Requests, though.  I need to do
a bit more research before I can start to tackle that one.
This commit is contained in:
Josh Sullivan
2013-11-05 03:10:07 -05:00
committed by Brendan Forster
parent dd220d7bf9
commit c81d8d08f7
7 changed files with 430 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
using Octokit;
using Xunit;
public class PullRequestRequestTests
{
public class TheToParametersDictionaryMethod
{
[Fact]
public void ContainsSetValues()
{
var request = new PullRequestRequest
{
State = ItemState.Closed,
Head = "user:ref-name",
Base = "fake_base_branch"
};
var parameters = request.ToParametersDictionary();
Assert.Equal("closed", parameters["state"]);
Assert.Equal("user:ref-name", parameters["head"]);
Assert.Equal("fake_base_branch", parameters["base"]);
}
[Fact]
public void ReturnsDefaultValuesForDefaultRequest()
{
var request = new PullRequestRequest();
var parameters = request.ToParametersDictionary();
Assert.Equal("open", parameters["state"]);
}
}
}