Skip to content

Instantly share code, notes, and snippets.

Avatar
🏡
On holidays, not checking notifications

Brendan Forster shiftkey

🏡
On holidays, not checking notifications
View GitHub Profile
View clean-merged-branches.ps1
$dontcare = git fetch origin --prune
$branches = git branch -a --merged |
?{$_ -match "remotes\/origin"} |
?{$_ -notmatch "\/master"} |
%{$_.Replace("remotes/origin/", "").Trim() }
if (-not $branches) {
echo "No merged branches detected"
exit 0
}
@shiftkey
shiftkey / test.cs
Created Oct 13, 2011 — forked from anonymous/test.cs
Good test/ bad test?
View test.cs
[TestMethod]
public void GetContextId_OnSecondRun_ReturnsStoredContextId() // "should" is a grey phrase
{
const string firstId = "200"; // context is used a lot in the test - removed here
const string secondId = "400"; // and i isolate these from my arrange for readability
// arrange
var record = new ContextRecord();
fakeRecordGenerator.Generate().Returns(record); // overuse of "Record" in here? necessary?
fakeContextService.CreateContext(record).Returns(firstId);
You can’t perform that action at this time.