Created
August 26, 2012 06:03
-
-
Save smallgeek/3474795 to your computer and use it in GitHub Desktop.
NaturalSpec_Tutorial_3_1
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
// 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