Skip to content

Instantly share code, notes, and snippets.

View DotNetNerd's full-sized avatar

Christian Holm Diget DotNetNerd

View GitHub Profile
@DotNetNerd
DotNetNerd / Canopy
Created May 8, 2013 07:35
Basic webtest with canopy
open canopy
open runner
start firefox
"Go to fona and add to basket" &&& fun _ ->
url "http://www.fona.dk"
let numberOfLineItems = (elements "#miniCartProducts li").Length
let total = read ".miniCartValue"
@DotNetNerd
DotNetNerd / CLIMutable
Created May 8, 2013 07:33
Using F# CLIMutable and ImpromptuInterface.FSharp with Dapper
[<CLIMutable>]
type Person = { Name : string; Age : int }
//Nuget: ImpromptuInterface.FSharp
use conn = new SqlCeConnection("Data Source=C:\Databases\MyDB.sdf;Persist Security Info=False;")
conn.Open()
let result =
conn.Query("SELECT * FROM People")
@DotNetNerd
DotNetNerd / FUnit and Foq
Created May 8, 2013 07:31
FUnit and Foq sample
namespace Library1.Tests
open NUnit.Framework
open FsUnit
open Foq
type person = {Name : string ; PhoneNumber: string}
type IPhoneNumberRepository =
abstract member FindPhoneNumber : string -> string
@DotNetNerd
DotNetNerd / NancyBoostrapper
Created January 18, 2012 18:34
Nancy service bootstrapper sample
public class ServiceBootstrapper : NancyBootstrapperBase<IWindsorContainer>
{
bool _modulesRegistered;
protected override IEnumerable<IStartup> GetStartupTasks()
{
return ApplicationContainer.ResolveAll<IStartup>();
}
protected override INancyEngine GetEngineInternal()