Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for task 3 of wizards and warriors exercise #1954

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions exercises/concept/wizards-and-warriors/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ Implement the `Wizard.PrepareSpell()` method to allow a Wizard to prepare a spel
```csharp
var wizard = new Wizard();
wizard.PrepareSpell();
wizard.Vulnerable();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think that the vulnerability of Wizards should be a concern at that point.
Since the next task of the exercise is setting the wizard to be not vulnerable after preparing a spell, at this point they should only be concerned with having a boolean property "IsSpellPrepared" set to true;

// => false
```

## 4. Make Wizards vulnerable when not having prepared a spell
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ public void Warrior_is_not_vulnerable()
Assert.False(warrior.Vulnerable());
}

[Fact]
[Task(3)]
public void Wizard_is_not_vulnerable_after_preparing_spell()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the exact same test as the one starting on line 49, and I don't think it concerns Task 3, since up to that point, it doesn't matter the vulnerability of the wizard after preparing a spell.
It might be useful to add another method called IsSpellPrepared() that you could use to test if the state of the spell is actually being saved.

{
var wizard = new Wizard();
wizard.PrepareSpell();
Assert.False(wizard.Vulnerable());
}

[Fact]
[Task(4)]
public void Wizard_is_vulnerable()
Expand Down