No FAA0001 when `?.` is followed by `Should().BeApproximately`
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 静か
- 技術スタック
- csharp
- 領域
- testing-qa
調査の方向性
まず、actual?.Amount.Should().BeApproximately(3.14, 0.01) を使用した C# の例で問題を再現し、次に BeApproximately に対する FAA0001 の処理を BeGreaterThan、BePositive、BeInRange と比較します。BeApproximately のケースでアナライザーが FAA0001 を報告し、他の assertions では既存の動作が維持されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Suppose for the sake of this bug report that we have the following type:
public interface IExample {
double Amount { get; }
}
Then if we write the following incorrect test:
public void TestMethod() {
IExample? actual = null;
actual?.Amount.Should().BeApproximately(3.14, 0.01); // no FAA0001 here?!
}
then we get no message from FluentAssertions.Analyzers about the wrong code.
For other assertions, this works fine. For example:
actual?.Amount.Should().BeGreaterThan(3.1); // good, we get 'FAA0001: Use .Should() instead of ?.Should()'
or:
actual?.Amount.Should().BePositive(); // good, we get 'FAA0001: Use .Should() instead of ?.Should()'
or:
actual?.Amount.Should().BeInRange(3.1, 3.2); // good, we get 'FAA0001: Use .Should() instead of ?.Should()'
We need the FAA0001 with .BeApproximately(3.14, 0.01) as well. Without it, the author may think his tests proves actual is an instance where Amount equals 3.14 within a tolerance of 0.01 when in fact actual is a null reference (and no Amount exists).
- 主要言語
- C#
- スター
- 131
- フォーク
- 25
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fluentassertions/fluentassertions.analyzers のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 58/100
fluentassertions/fluentassertions.analyzers#404 · リアクション 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
fluentassertions/fluentassertions.analyzers#403 · コメント 6 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
fluentassertions/fluentassertions.analyzers#400 · コメント 2 件 ·
-
Use Microsoft.CodeAnalysis.Testing for tests対応中かも @Meir017 が 733 日前に担当しました。 オープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
fluentassertions/fluentassertions.analyzers の issue をすべて見る
似ている issue
-
status:waiting-for-triage type:bug
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
microsoftgraph/msgraph-sdk-dotnet#3194 ·
メンテナーはふだん 1 日以内に返信
-
Backend enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
UI: money shows the minus sign next to the number, not before the currency (IL -3.0m, not -IL 3.0m)オープンarea: sim area: unity enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
eyalgolan/statecraft-israel#1107 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
dimitar-radenkov/Pointframe#271 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
qew21/Genshin-Subtitles#45 ·