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 Tests | |
{ | |
using System.Collections.Generic; | |
using System.Linq; | |
using JsonFx.Json; | |
using Should.Fluent; | |
using Xunit; |
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 iDoc.specs.When | |
{ | |
[Subject("AccountManagement")] | |
public class CreatingAUserAccount : BaseContext<AccountController> | |
{ | |
const string EmailAddress = @"[email protected]"; | |
Establish context = () => | |
{ | |
model = new RegistrationModel { |
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
Sub ReplaceSpacesWithUnderscores() | |
Dim textSelection As EnvDTE.TextSelection | |
textSelection = CType(DTE.ActiveDocument.Selection(), EnvDTE.TextSelection) | |
textSelection.Text = textSelection.Text.Replace(" ", "_") | |
End Sub |
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 Graeme | |
{ | |
using System.Collections.Generic; | |
using System.ComponentModel.Composition; | |
using System.Linq; | |
using CodeFest2PlayerRef; | |
[Export(typeof(ICanPlayCodeFest2))] | |
public class Player : ICanPlayCodeFest2 |
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
Fake.GetCalls(_log). | |
Single(call => call.Method.Name == "set_Offset"). | |
GetArgument<TimeSpan>(0). | |
Should().Equal(newOffset); |
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 class MyFixture | |
{ | |
private readonly ICloseLogFileCommand _closeCommand = Mock.Of<ICloseLogFileCommand>(); | |
private readonly ILog _log = Mocks.Of<ILog>(). | |
First(x => x.Name == @"C:\Path\To\File.log" && | |
x.Count == 42 && | |
x.Offset == TimeSpan.FromSeconds(69)); | |
... | |
} |
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 class MyFixture | |
{ | |
private readonly ICloseLogFileCommand _closeCommand = Substitute.For<ICloseLogFileCommand>(); | |
private readonly ILog _log = Substitute.For<ILog>(); | |
public MyFixture() | |
{ | |
_log.Name.Returns(@"C:\Path\To\File.log"); | |
_log.Count.Returns(42); |
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 class MyFixture | |
{ | |
private readonly ICloseLogFileCommand _closeCommand = A.Fake<ICloseLogFileCommand>(); | |
private readonly ILog _log = A.Fake<ILog>(); | |
public MyFixture() | |
{ | |
A.CallTo(() => _log.Name).Returns(@"C:\Path\To\File.log"); | |
A.CallTo(() => _log.Count).Returns(42); |
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(); | |
Mock.Get(_parserPresenter).Verify(x => x.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 Initialize_Always_InitializesParserPresenter() | |
{ | |
LogPresenter test = BuildTestSubject(); | |
test.Initialize(); | |
A.CallTo(() => _parserPresenter.Initialize()).MustHaveHappened(); | |
} |