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 abstract class BDD<T> where T : BDD<T> | |
{ | |
protected T Given { get { return (T)this; } } | |
protected T When { get { return (T)this; } } | |
protected T Then { get { return (T)this; } } | |
protected T And { get { return (T)this; } } | |
} |
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
[TestMethod] | |
public void Fires_event_when_recording_is_complete() | |
{ | |
string filename = null; | |
viewModel.RecordingComplete += (o, e) => filename = e.Filename; | |
viewModel.RecordingCommand.Execute(null); // Start recording | |
viewModel.RecordingCommand.Execute(null); // Stop recording | |
Assert.IsNotNull(filename, "Should fire event when recording is complete."); |
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
<UserControl x:Class="UsercontrolContentControl.Overlay" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Width="400" Height="300"> | |
<Grid x:Name="LayoutRoot" Background="White"> | |
<ContentControl Content="{Binding OverlayContent}" /> | |
</Grid> | |
</UserControl> | |
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 BlackBox.CodeGeneration | |
{ | |
public class TestFlavour | |
{ | |
public string Namespace { get; private set;} | |
public string TestAttribute { get; private set; } | |
public string ClassAttribute { get; private set; } | |
public string SetupAttribute { get; private set; } | |
public bool ConstructorAsSetup() |
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 AirlineNamesService | |
{ | |
private readonly Uri _serviceUrl; | |
public AirlineNamesService() | |
{ | |
_serviceUrl = new Uri("http://flydata.avinor.no/airlineNames.asp"); | |
} | |
public IObservable<Airline> GetAirlines() |
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
// Tiniest BDD DSL/framework around? | |
// Licensed under MSPL/FreeBSD/ISC or any other OSS license you want | |
// Original idea from http://blog.kjempekjekt.com/2009/08/13/ultra-tiny-given-when-then-dsl-snippet/, | |
// turned into generic base class by Jonas Follesø. | |
public abstract class BDD<T> where T : BDD<T> | |
{ | |
protected T Given { get { return (T)this; } } | |
protected T And { get { return (T)this; } } | |
protected T When { get { return (T)this; } } |
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
[TestClass] | |
public class XmlFormatDetectorTest : BDDTest<XmlFormatDetectorTest> | |
{ | |
[TestMethod] | |
public void Detects_that_a_file_follows_the_FHNBransjestandard1_format() | |
{ | |
Given.we_got_a_file("FNHBransjestandard1.xml"); | |
When.we_try_to_detect_the_file_format(); | |
Then.fileformat.ShouldBe(KnownFileFormats.FNHBransjestandard1); | |
} |
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
using System.Collections; | |
using System.Collections.Generic; | |
using Microsoft.VisualStudio.TestTools.UnitTesting; | |
namespace KS.Bestandsrapportering.TestInfrastruktur | |
{ | |
public static class TestExtensions | |
{ | |
public static void SkalVæreLik(this object valueToTest, object expected) | |
{ |
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
[TestClass] | |
public class SomeTest | |
{ | |
[TestMethod] | |
public void Test_threaded_code() | |
{ | |
var db = new SomeDbMock(); | |
var bl = new SomeCode(db); | |
bl.DoSomething(); |
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 void UseSomeDynamicCode() | |
{ | |
IDoSomething wrapper = DynamicWrapper.Wrap<IDoSomething>("some_script.rb"); | |
int sum = wrapper.Add(5, 5); | |
} | |
public interface IDoSomething | |
{ | |
int Add(int a, int b); | |
} |
OlderNewer