fluentassertions / fluentassertions/fluentassertions.analyzers

Create a refactoring for asserting exceptions properties

オープン
#55 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
idea
主要言語
C#
スター
131
フォーク
25
PR マージ指標
30日以内にマージされた PR はありません

説明

for example:

```cs
public class MyCustomException : Exception
{
public string MyCustomProperty { get; }

public MyCustomException(string myCustomProperty)
{
MyCustomProperty = MyCustomProperty;
}
}
```

when hovering over the property `MyCustomProperty` I would like to have a suggestion to generate an assertion for that property.

The generated assertion will something like this:
```cs
public static class MyCustomExceptionExtensions
{
public static ExceptionAssertions WithMyCustomProperty(this ExceptionAssertions assertions,
string expectedMyCustomProperty, string because = "", params object[] becauseArgs) where TException : MyCustomException
{
Execute.Assertion
.ForCondition(assertions.And.MyCustomProperty.Equals(expectedMyCustomProperty))
.BecauseOf(because, becauseArgs)
.FailWith("Expected exception with MyCustomProperty {0}{reason}, but found {1}.", assertions.And.MyCustomProperty, expectedMyCustomProperty);
return assertions;
}
}
```

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

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

issue ではファイル、テスト、エントリポイントが指定されていないため、まず analyzer の refactoring 実装とそのテストを見つけます。要求された C# の例外プロパティの例を使って生成される assertion を定義し、プロパティにホバーしたときに期待される出力の refactoring が提示されることを確認します。

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

評価

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

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

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