Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Writes, runs, and repairs .NET NUnit tests, covering attributes, assertions, NUnit3TestAdapter, and NUnit.Analyzers configuration.
91% 100%+9 ptsof test cases passed
Passed 22 of 22 test cases with the skill, and 20 of 22 without it.
Write an NUnit assertion checking that a list of numbers contains exactly 5 elements, all elements are greater than 0, and the list is sorted.
Uses constraint model Is.All.GreaterThan
3 of 3 safety checks passed
// WRONG - Tests multiple unrelated things
[Test]
public void UserService_Works()
{
var user = _service.CreateUser("[email protected]");
Assert.That(user, Is.Not.Null);
var updated = _service.UpdateUser(user.Id, "[email protected]");
Assert.That(updated.Email, Is.EqualTo("[email protected]"));
_service.DeleteUser(user.Id);
var deleted = _service.GetUser(user.Id);
Assert.That(deleted, Is.Null);
}
// CORRECT - One test per behavior
[Test]
public void CreateUser_ValidEmail_ReturnsUser()
{
var user = _service.CreateUser("[email protected]");
Assert.That(user, Is.Not.Null);
}
[Test]
public void UpdateUser_NewEmail_UpdatesEmail()
{
var user = _service.CreateUser("[email protected]");
var updated = _service.UpdateUser(user.Id, "[email protected]");
Assert.That(updated.Email, Is.EqualTo("[email protected]"));
}
[Test]
public void DeleteUser_ExistingUser_RemovesUser()
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.