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
[Given(@"the following features in the database:")] | |
public void GivenTheFollowingFeaturesInTheDatabase(Table table) | |
{ | |
// 1. Create a list of features => drive forth the feature class | |
var features = table.CreateSet<Feature>().ToList(); | |
// 2. Create an substitute that returns that list | |
var dbWrapperSubsitute = Substitute.For<IFeatureDBWrapper>(); | |
dbWrapperSubsitute.AllNotDone().Returns(features); |
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 Specs.EndToEnd.Helpers; | |
using TechTalk.SpecFlow; | |
namespace Specs.EndToEnd | |
{ | |
[Binding] | |
public class SpecFlowHooks | |
{ | |
[AfterScenario] |
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 class ActivityDbEntity | |
{ | |
public string Heading { get; set; } | |
public string NumberOfHours { get; set; } | |
public string Date { get; set; } | |
public string Coach { get; set; } | |
public string Customer { get; set; } | |
} |
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
// This is the interface i want to Subsitute | |
public interface ICustomerRepository | |
{ | |
IQueryable<Customer> All { get; } // This property | |
IQueryable<Customer> AllIncluding(params Expression<Func<Customer, object>>[] includeProperties); | |
Customer Find(int id); | |
void InsertOrUpdate(Customer customer); | |
void Delete(int id); | |
void Save(); | |
} |
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.ObjectModel; | |
using System.ServiceModel; | |
using System.ServiceModel.Activation; | |
using System.ServiceModel.Channels; | |
using System.ServiceModel.Description; | |
using System.ServiceModel.Dispatcher; | |
/* | |
* This is an TinyIoC implemention of the example in the excellent blog post by Jimmy Boggard |
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
@IList<Person> model = (IList<Person>)Model; | |
<!DOCTYPE HTML /> | |
<html> | |
<head></head> | |
<body> | |
<ul> | |
@foreach (Person p in Model) | |
{ | |
<li>@p.name</li> |
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
$ git push origin master | |
Counting objects: 106, done. | |
Compressing objects: 100% (103/103), done. | |
Received disconnect from 207.97.227.239: 2: Corrupted MAC on input. | |
fatal: sha1 file '<stdout>' write error: Invalid argument | |
fatal: The remote end hung up unexpectedly | |
error: failed to push some refs to '[email protected]:marcushammarberg/SpecFlow.Ass | |
ist.Dynamic.git' |
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
[Binding] | |
public class DynamicStepArgumentTransformations | |
{ | |
[StepArgumentTransformation] | |
public IEnumerable<object> TransformToEnumerable(Table table) | |
{ | |
return table.CreateDynamicSet(); | |
} |
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
[StepArgumentTransformation] | |
public T CreateUser<T>(Table table) where T : new() | |
{ | |
// magic happens here stuff | |
// or this line | |
// any case a new T gets created | |
return table.CreateInstance<T>(); | |
} | |
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.Collections.Generic; | |
using Nancy; | |
using Nancy.Bootstrapper; | |
using NSubstitute; | |
using NUnit.Framework; | |
namespace UnitTests | |
{ | |
[TestFixture] | |
public class AbbeQuotesModuleTests |
OlderNewer