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
void Main() | |
{ | |
var kernel = new Ninject.StandardKernel(new EntitieseModule(), new DocumentStoreModule(), new ModelRepositoryModule()); | |
} | |
public interface IModelRepository<T> where T: IModel | |
{ | |
//interface stuff here | |
} |
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
void Main() | |
{ | |
// nunit runner | |
NUnit.ConsoleRunner.Runner.Main(new string[] | |
{ | |
Assembly.GetExecutingAssembly().Location, | |
}); | |
} | |
public interface IBookMarket |
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
void Main() | |
{ | |
using(var kernel = new StandardKernel(new ExampleKernel())) | |
{ | |
var d6 = kernel.Get<Die>(); | |
var d20 = kernel.Get<Die>(new ConstructorArgument("numSides", 20)); | |
d6.NumSides.Dump(); | |
d20.NumSides.Dump(); | |
} |
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
void Main() | |
{ | |
// add references: nunit.framework.dll and nunit-console-runner.dll | |
// nunit runner | |
NUnit.ConsoleRunner.Runner.Main(new string[] | |
{ | |
Assembly.GetExecutingAssembly().Location, | |
}); | |
} |
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
Write-Host 'throw' | |
try | |
{ | |
try | |
{ | |
throw "exception" | |
} | |
catch | |
{ |
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
void Main() | |
{ | |
// add assembly System.Linq.Dynamic and using System.Linq.Dynamic | |
var fruits = new [] { new Product { Id = 1, ColA = "Apple", ColB = "Red" }, new Product { Id = 2, ColA = "IceCream", ColB = "White" } }; | |
var cars = new [] { new Product { Id = 1, ColA = "Ferrary", ColB = "Red" }, new Product { Id = 2, ColA = "Ford", ColB = "Black" } }; | |
var predicate = | |
PredicateBuilder | |
.True<Tuple<Product, Product>>() |
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
void Main() | |
{ | |
var input = @"{TEST} is {TEST}"; | |
ObtainTokens(input).Dump(); | |
} | |
public static IEnumerable<string> ObtainTokens(/*this*/ string originalString) | |
{ | |
Regex expression = new Regex(@"{(\w*)}"); |
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
void Main() | |
{ | |
// add NUnit and RhinoMocks | |
SomeRule_InsertInfo_WasInserted(); | |
SomeRule_GetInfo_ReciveCorrectInfo(); | |
} | |
// DTO | |
public class Info |
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
/// <summary> | |
/// Builds the configuration. | |
/// </summary> | |
/// <returns>nHibernate SQLite configuration</returns> | |
protected override Configuration BuildConfiguration() | |
{ | |
CleanUpDbFileIfRequired(); | |
return Fluently.Configure() | |
.Database(SQLiteConfiguration.Standard.InMemory() |
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
void Main() | |
{ | |
var kernel = new StandardKernel(); | |
kernel.Load<FuncModule>(); // for sake of LinqPAD | |
kernel.Bind<IJobFactory>().ToFactory(); | |
// wire concreet implementation of | |
kernel |
OlderNewer