Skip to content
This repository was archived by the owner on Sep 20, 2022. It is now read-only.

Commit 27d5e5a

Browse files
author
Jake Ginnivan
committed
Added test around publishing release to GitHub, fixes #5
1 parent 62a6d4a commit 27d5e5a

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/GitReleaseNotes.Tests/IssueTrackers/GitHub/GitHubIssueTrackerTests.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,22 @@ public void MustSpecifyVersionWhenPublishFlagIsSet()
116116
_log.Received().WriteLine("You must specifiy the version [/Version ...] (will be tag) when using the /Publish flag");
117117
}
118118

119+
[Fact]
120+
public void CanCreateReleaseOnGitHub()
121+
{
122+
const string releaseNotesOutput = " - A thingy was fixed";
123+
_sut.PublishRelease(releaseNotesOutput, new GitReleaseNotesArguments
124+
{
125+
Repo = "Foo/Baz",
126+
Version = "1.2.0"
127+
});
128+
129+
_gitHubClient.Release
130+
.Received()
131+
.CreateRelease("Foo", "Baz",
132+
Arg.Is<ReleaseUpdate>(r => r.TagName == "1.2.0" && r.Body == releaseNotesOutput && r.Name == "1.2.0"));
133+
}
134+
119135
private static Commit CreateCommit(string message, DateTimeOffset when)
120136
{
121137
var commit = Substitute.For<Commit>();

0 commit comments

Comments
 (0)