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
open canopy | |
open runner | |
start chrome | |
"#lastName should have Doe" &&& (fun _ -> | |
url "http://lefthandedgoat.github.io/canopy/testpages/" | |
let jsResult = js "return $('#testfield1');" | |
let jsResult2 = js "return document.getElementById('testfield1');" | |
let i = 0 |
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
// Learn more about F# at http://fsharp.net | |
open System | |
let mutable tests = [] | |
let test f = tests <- List.append tests [f] | |
let xtest f = () | |
let mutable before = fun () -> () | |
let run _ = List.map (fun f -> (before () | |
f ())) tests | |
let describe description = Console.WriteLine(description.ToString()) |
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
Sign up for a GitHub Account Sign in | |
Gist is a simple way to share snippets and pastes with others. All gists are git repositories, so they are automatically versioned, forkable and usable as a git repository. | |
language: F# ACE Editor indent mode: Spaces indent size: 2 | |
230 | |
231 | |
232 | |
233 |
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
open canopy | |
open runner | |
open Microsoft.FSharp.Reflection | |
type command = | |
| Ram | |
| Dragon | |
| Rat | |
| Tiger | |
| Dog |
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
module gherkin | |
open System.Text.RegularExpressions | |
open System.Linq | |
type Mode = Given | When | Then | |
type gwt () = class | |
let mutable mode = Given | |
let mutable givens : (unit -> unit) list = [] | |
let mutable whens : (unit -> unit) list = [] |
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
// Learn more about F# at http://fsharp.net | |
open System | |
let mutable tests = [] | |
let test f = tests <- List.append tests [f] | |
let xtest f = () | |
let mutable before = fun () -> () | |
let run _ = List.map (fun f -> (before () | |
f ())) tests | |
let describe description = Console.WriteLine(description.ToString()) |
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
// Learn more about F# at http://fsharp.net | |
open canopy | |
open runner | |
let switchTo b = browser <- b | |
let index = "http://dry-peak-5299.herokuapp.com/" | |
let createGame = ".nav li a" | |
let cardCzar = "#notificationCardCzar" | |
let waiting = "#notificationWaitingOnRound" |
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
let setTerminationDate agentNumber toTerminated = | |
using(new AgencyManagement()) (fun db -> | |
let agent = query <@ seq { for a in db.Agents do | |
if a.AgentNumber = agentNumber then yield a } @> |> Seq.head | |
if toTerminated = true then | |
agent.TerminationDate <- new Nullable<DateTime>(DateTime.Now) | |
else | |
agent.TerminationDate <- new Nullable<DateTime>() | |
db.SaveChanges() |> ignore | |
) |
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
//test framework | |
open System | |
let mutable tests = [] | |
let test f = tests <- List.append tests [f] | |
let xtest f = () | |
let mutable before = fun () -> () | |
let run _ = List.map (fun f -> (before () | |
f ())) tests | |
let describe description = Console.WriteLine(description.ToString()) | |
let (==) value1 value2 = |
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
module runner | |
let mutable tests = [] | |
let test f = tests <- List.append tests [f] | |
let xtest f = () | |
let mutable before = fun () -> () | |
let run _ = List.map (fun f -> (before () | |
f ())) tests | |
let (==) value1 value2 = System.Console.WriteLine("{0} expected: {1} got: {2}", (value1 = value2), value2, value1) | |
let describe description = System.Console.WriteLine(description.ToString()) |