0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Assert.Thatを使いましょう - NUnit2005

Posted at

次のように警告(Warning)が表示されていたのでテストコードを修正しました。

warning NUnit2005: Consider using the constraint model, Assert.That(actual, Is.EqualTo(expected)), instead of the classic model, Assert.AreEqual(expected, actual)

なんでもAssert.AreEqual(expected, actual)だとActualとExpectedの順番を間違えやすいということでAssert.That()を使いましょうとのこと(source)。

ConstrainモデルのConstrainについては下記。
https://docs.nunit.org/articles/nunit/writing-tests/constraints/Constraints.html

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?