New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
テストのカテゴリ化 #26
Milestone
Comments
Closed
テストエクスプローラの「特徴」によるフィルタリングで使える気がする。モデルには何らかの情報として持たせておきたいが、今すぐ活用するかと言うと疑問。 |
テストのカテゴリ化について考えてみました。 型
type TestMetadata =
val Name : string
val Categories : string[]
... カテゴリの設定方法1. テストケースに設定する下記シグネチャの関数で、テストケースにカテゴリを設定する val category : name:string -> test:TestCase<'T> -> TestCase<'T> 例// テストにカテゴリを設定する
let test1 = test { do! pass() } |> category "CategoryA"
// パラメタライズテスト
let test2 = parameterize {
source [ 1 ]
run (fun _ -> test { do! pass() } |> category "CategoryB")
} 2. モジュール配下の全テストに設定する下記属性をモジュールに付けると、モジュール配下の全テストにカテゴリが設定される type CategoryAttribute = class end 例[<Category("CategoryC")>]
module SomeTest =
// "CategoryC" というカテゴリが設定される
let test3 = test { do! pass() }
// "CategoryC" と "CastegoryD" が設定される
let test4 = test { do! pass() } |> category "CategoryD"
[<Category("CategoryE")>]
module NestedModule =
// "CategoryC" と "CategoryE" が設定される
let test5 = test { do! pass() } カテゴリの実行方法指定したカテゴリを実行する
指定したカテゴリ以外を実行する
その他1. テストを合成した場合はカテゴリについて次のような場合に、 let test1 = test { return 1 } |> category "CategoryA"
let test2 = test {
let! x = test1
do! x |> assertEquals 1
} |
implemented #126 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No description provided.
The text was updated successfully, but these errors were encountered: