This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// before | |
testSubject.Invoking(ts => ts.F()) | |
.ShouldThrow<Exception>() | |
.WithMessage("the foo was out of range (...)"); | |
// after | |
testSubject.Invoking(ts => ts.F()) | |
.ShouldThrow<FooOutOfRangeException>() | |
.And.Foo.Should().Be("..."); | |
new FooOutOfRangeException("...").Message.Should().Be("the foo was out of range (...)"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FooOutOfRangeException : Exception | |
{ | |
public readonly string Foo; | |
public FooOutOfRangeException(string foo) | |
{ | |
Foo = foo; | |
} | |
public override string Message |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
throw new Exception(string.Format("The foo was out of range ({0})", foo)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int X = 0; | |
Task.Run(() => | |
{ | |
Thread.Sleep(TimeSpan.FromSeconds(1)); | |
X++; | |
}); | |
{// Extract Method on this block | |
Thread.Sleep(TimeSpan.FromSeconds(2)); | |
Assert.AreEqual(1, X); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[13:17:11.5175-LocalBuildTask-33] ERROR (Internal): System.NullReferenceException: Object reference not set to an instance of an object. | |
at nCrunch.Common.IO.DirectoryPath.GetNumberOfCommonDirectories(DirectoryPath path1, DirectoryPath path2) | |
at nCrunch.Common.IO.DiskPath.DoRebase(DirectoryPath originalBase, DirectoryPath newBase) | |
at nCrunch.Common.IO.FilePath.Rebase(DirectoryPath originalBase, DirectoryPath newBase) | |
at nCrunch.Core.BuildManagement.BuildEnvironment.(DirectoryPath , IList`1 ) | |
at nCrunch.Core.BuildManagement.BuildEnvironment.Build(SnapshotComponent snapshotComponentToBuild, IList`1 referencedComponents, GridClientId gridClientId, CustomEnvironmentVariable[] customEnvironmentVariables) | |
at nCrunch.Core.Processing.BuildTaskLogic.DoProcessTaskAndReturnSuccessFlag() | |
at nCrunch.Core.Processing.TaskLogic.ProcessTaskAndReturnSuccessFlag() | |
at nCrunch.Client.Processing.LocalProcessingTask.ProcessTaskAndReturnSuccessFlag() | |
at nCrunch.Client.Processing.ProcessingQueue.(LocalP |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If provided, get and log the response from the remote host. | |
IfProvidedGetAndLogResponseFromRemoteHost(logger, ex.Response); | |
// --------------------------------------- | |
void IfProvidedGetAndLogResponseFromRemoteHost(logger, webResponse) | |
{ | |
var response = string.Empty; | |
if (response != null) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// If provided, get and log the response from the remote host. | |
var response = string.Empty; | |
if (ex.Response != null) | |
{ | |
using (var readerStream = new StreamReader(ex.Response.GetResponseStream())) | |
{ | |
response = readerStream.ReadToEnd().Trim(); | |
logger.Error("Error response:"); | |
logger.Error(response); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# dev | |
http://boxstarter.org/package/sysinternals,resharper,ncrunch,git,poshgit | |
# desktop | |
http://boxstarter.org/package/lastpass,googlechrome,skype,steam,putty,dotnet35 | |
# kids | |
http://boxstarter.org/package/minecraft,vlc | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
private static void Main(string[] args) | |
{ | |
switch (args[0]) | |
{ | |
case "foo": | |
{ | |
IOperation operation = new FooOperation(); | |
operation.Do(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
private static void Main(string[] args) | |
{ | |
IOperation operation; | |
switch (args[0]) | |
{ | |
case "foo": | |
{ | |
operation = new FooOperation(); |