public void Should_Throw_If_Target_Branch_Not_Found() { // Given var fixture = new CreatePullRequestFixture( BasePullRequestFixture.ValidTfsUrl, "testBranch", "NotExistingBranch", "test", "test"); // When var result = Record.Exception(() => TfsPullRequest.Create(fixture.Log, fixture.GitClientFactory, fixture.Settings)); // Then result.IsTfsBranchNotFoundException($"Branch not found \"NotExistingBranch\""); }
public void Should_Throw_If_Settings_Are_Null() { // Given var fixture = new CreatePullRequestFixture( BasePullRequestFixture.ValidTfsUrl, "testBranch", "NotExistingBranch", "test", "test"); TfsCreatePullRequestSettings settings = null; // When var result = Record.Exception(() => TfsPullRequest.Create(fixture.Log, fixture.GitClientFactory, settings)); // Then result.IsArgumentNullException("settings"); }
public void Should_Throw_If_Log_Is_Null() { // Given var fixture = new CreatePullRequestFixture( BasePullRequestFixture.ValidTfsUrl, "testBranch", "NotExistingBranch", "test", "test"); ICakeLog log = null; // When var result = Record.Exception(() => TfsPullRequest.Create(log, fixture.GitClientFactory, fixture.Settings)); // Then result.IsArgumentNullException("log"); }
public void Should_Return_A_PullRequest_With_Fallback_To_Default_Target_Branch() { // Given var sourceRefName = "testBranch"; string targetRefName = null; var title = "foo"; var description = "bar"; var fixture = new CreatePullRequestFixture( BasePullRequestFixture.ValidTfsUrl, sourceRefName, targetRefName, title, description); // When TfsPullRequest.Create(fixture.Log, fixture.GitClientFactory, fixture.Settings); // Then // Return is a mocked pull request unrelated to the input values }