For boolean properties, support "hasPropertyName(boolean expectedValue)"

オープン
#125 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
java
領域
testing, tooling

調査の方向性

まず、boolean プロパティ用のメソッドを生成する assertion generator のロジックを見つけ、要求された API と既存の BooleanAssert パターンを比較します。生成されるメソッドを hasHideLegend(boolean) にするべきか、等価性に特化したバリエーションにするべきかを判断し、生成された assertion が期待される両方の boolean 値を処理できることを示すカバレッジを追加します。

索引モデルが issue の本文から書いたものです。

説明

Currently if a class has a boolean field / property (say hideLegend, the assertion generator produces two methods: isHideLegend() and isNotHideLegend. It would be really helpful to have an additional method hasHideLegend(boolean expectedValue). To keep with the BooleanAssert pattern, this might become hasHideLegendEqualTo(boolean) and hasHideLegendNotEqualTo(boolean). This is demonstrated by the example below:

private void testHelperMethod(MyAssertionClass instanceUnderTest, SomeInput input){
    boolean expectedHasLegend = // some code that uses input to determine expected legend;
    MyAssertionClassAssert assert = Assertions.assertThat(instanceUnderTest);

    if (expectedHadLengeng)
       assert.isHideLegend();
    else 
       assert.isNotHideLegend();
}

The above could become:

private void testHelperMethod(MyAssertionClass instanceUnderTest, SomeInput input){
    boolean expectedHasLegend = // some code that uses input to determine expected legend;
    Assertions.assertThat(instanceUnderTest)
      hasHideLegend(expectedHasLegend );
}
主要言語
Java
スター
72
フォーク
47
PR マージ指標
30日以内にマージされた PR はありません

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

assertj/assertj-generator のほかの issue

assertj/assertj-generator の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。