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
[Fact] | |
public void Initialize_Always_InitializesParserPresenter() | |
{ | |
LogPresenter test = BuildTestSubject(); | |
test.Initialize(); | |
_parserPresenter.Received().Initialize(); | |
} |
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
[Fact] | |
public void Offset_WhenLogOffsetChanges_RaisesPropertyChanged() | |
{ | |
LogPresenter test = BuildTestSubject(); | |
test.Initialize(); | |
test.AssertThatChangeNotificationIsRaisedBy(x => x.Offset). | |
When(() => Mock.Get(_log).Raise(x => x.PropertyChanged += null, | |
new PropertyChangedEventArgs("Offset"))); |
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
[Fact] | |
public void Offset_WhenLogOffsetChanges_RaisesPropertyChanged() | |
{ | |
LogPresenter test = BuildTestSubject(); | |
test.Initialize(); | |
test.AssertThatChangeNotificationIsRaisedBy(x => x.Offset). | |
When(() => _log.PropertyChanged += Raise.Event<PropertyChangedEventHandler>(this, | |
new PropertyChangedEventArgs("Offset"))); |
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
[Fact] | |
public void Offset_WhenLogOffsetChanges_RaisesPropertyChanged() | |
{ | |
LogPresenter test = BuildTestSubject(); | |
test.Initialize(); | |
test.AssertThatChangeNotificationIsRaisedBy(x => x.Offset). | |
When(() => _log.PropertyChanged += Raise.With(new PropertyChangedEventArgs("Offset")).Now); | |
} |
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
namespace Stuff | |
{ | |
#region Using Directives | |
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Linq.Expressions; | |
using Moq; |
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
private static void UpdatePropertyValue<T, TValue>(Expression<Func<T, TValue>> property, T fake, TValue newValue) where T : class | |
{ | |
property.Compile()(fake).Returns(newValue); | |
} |
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
System.IndexOutOfRangeException was unhandled | |
Message=Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader. | |
Source=System.CoreEx | |
StackTrace: | |
Server stack trace: | |
at System.Buffer.InternalBlockCopy(Array src, Int32 srcOffsetBytes, Array dst, Int32 dstOffsetBytes, Int32 byteCount) | |
at System.IO.StreamWriter.Write(Char[] buffer, Int32 index, Int32 count) | |
at System.IO.TextWriter.WriteLine(String value) | |
at System.IO.TextWriter.SyncTextWriter.WriteLine(String value) | |
at System.Console.WriteLine(String value) |
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
Comma and semicolon | |
Use the comma (,) and semi-colon (;) characters to indicate nonhierarchical portions | |
of the URI. The semicolon convention is used to identify matrix parameters: | |
http://www.example.org/co-ordinates;w=39.001409,z=-84.578201 | |
http://www.example.org/axis;x=0,y=9 | |
These characters are valid in the path and query portions of URIs, but not all code | |
libraries recognize the comma and semicolon as separators and may require custom |
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
public static class RequestExtensions | |
{ | |
public static string AsString(this RequestStream requestStream) | |
{ | |
return new StreamReader(requestStream).ReadToEnd(); | |
} | |
public static XDocument AsXml(this RequestStream requestStream) | |
{ | |
return XDocument.Load(requestStream); |
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
# Tools | |
.\NuGet.exe i DotCover -s \\myserver\Dev\NuGetPackages -o Tools | |
.\NuGet.exe i StyleCopCmd -s \\myserver\Dev\NuGetPackages -o Tools | |
# Dependecies | |
$packageConfigs = Get-ChildItem . -Recurse | where{$_.Name -eq "packages.config"} | |
foreach($packageConfig in $packageConfigs){ | |
Write-Host "Restoring" $packageConfig.FullName | |
nuget i $packageConfig.FullName -o Packages | |
} |