Skip to content

Instantly share code, notes, and snippets.

@smallgeek
Created August 26, 2012 06:03
Show Gist options
  • Save smallgeek/3474795 to your computer and use it in GitHub Desktop.
Save smallgeek/3474795 to your computer and use it in GitHub Desktop.
NaturalSpec_Tutorial_3_1
// 1. モジュールを定義する
module CarSpec
// 2. NaturalSpec 名前空間を開く
open NaturalSpec
// 3. プロジェクトの名前空間を開く
open CarSellingLib
// 4. テストコンテキストを定義する
let Bert = new Dealer("Bert")
// 5. BDDスタイルでメソッドを作成する
let selling_a_car_for amount (dealer:Dealer) =
printMethod amount
dealer.SellCar amount
// 6. シナリオを作成する
[<Scenario>]
let When_selling_a_car_for_30000_it_should_equal_my_DreamCar() =
As Bert
|> When selling_a_car_for 30000
|> It should equal (new Car(CarType.BMW, 200))
|> Verify
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment