This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.IO; | |
namespace AbsoluteToRelativePathTest | |
{ | |
public static class PathHelper | |
{ |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using TinyIoC; | |
using Nancy.BootStrapper; | |
using Nancy.Routing; | |
namespace Nancy | |
{ |
This file contains 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 interface IAbstractThings | |
{ | |
dynamic DoThings(params dynamic[] arguments); | |
} |
This file contains 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
[TestMethod] | |
public void ProcessMessage_LowerPacketSequenceNumberWithDifferentHandsetUid_RaisesBothEvents() | |
{ | |
var mockEventDispatcher = A.Fake<IDeviceEvents>(); | |
var fakeMessage1 = new HardwareMessage(MessageType.ReportKeyValue, 0, GetButtonPressParameters(1, 2, HardwareButton.BlueCircle)); | |
var fakeMessage2 = new HardwareMessage(MessageType.ReportKeyValue, 0, GetButtonPressParameters(2, 1, HardwareButton.BlueCircle)); | |
_ReportKeyValueHandler.ProcessMessage(_FakeDevice, mockEventDispatcher, fakeMessage1); | |
_ReportKeyValueHandler.ProcessMessage(_FakeDevice, mockEventDispatcher, fakeMessage2); |
This file contains 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 Should_support_implicit_casting_of_properties_to_guids_in_method_params() | |
{ | |
dynamic parameters = new DynamicDictionary(); | |
var guid = Guid.NewGuid(); | |
parameters["test"] = guid; | |
Guid value = this.GetGuid(parameters["test"]); | |
value.ShouldEqual(guid); |
This file contains 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
// The class under test (a "device") has one background thread which monitors the (fake) serial port for incoming | |
// data and places it on a queue for a second background thread to pickup, process and respond to. | |
// | |
// Normally I'd have to test this with Thread.Sleep, which is not only ugly, but also slows down every test as the | |
// sleep time would have to be long enough so machines under heavy load didn't fail. | |
// | |
// With Rx I can setup an observable on my fake serial port "Data Written" event and tell it to wait up to 5 seconds | |
// to receive and event of the correct type. Then I can simply pull those chunks of data out of the enumerable | |
// it produces and assert on them as normal. | |
// |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.IO; | |
namespace IndexerTest | |
{ | |
class Program | |
{ |
This file contains 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
using Microsoft.Practices.Unity; | |
using Nancy.ViewEngines; | |
namespace Nancy.Bootstrappers.Unity | |
{ | |
public class UnityEnumerableShim<T> : IEnumerable<T> | |
{ | |
private IUnityContainer container; | |
public UnityEnumerableShim(IUnityContainer container) |
This file contains 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 Pipelines | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
public class CancellablePipeline<TPipelineDelegateType, TReturnType> | |
where TReturnType : class | |
{ | |
public CancellablePipeline() |
This file contains 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 Nancy.Bootstrapper | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Nancy.Routing; | |
using Nancy.Extensions; | |
/// <summary> | |
/// Base class for container based Bootstrappers. |
OlderNewer