public void HeroIsntDead() { Hero hero = new Hero(1, "Slaughter", 10, 15, "Warrior", 1); var mock = new Mock <EnemyService>(); StoryManager storyManager = new StoryManager(new MenuActionService(), hero, mock.Object); hero.Health = 1; var returnedInformation = storyManager.IsHeroDead(hero); returnedInformation.Should().BeFalse(); }
public void HeroIsDead() { Hero hero = new Hero(1, "Slaughter", 10, 15, "Warrior", 1); var mock = new Mock <EnemyService>(); StoryManager storyManager = new StoryManager(new MenuActionService(), hero, mock.Object); hero.Health = 0; void act() => storyManager.IsHeroDead(hero); var ex = Record.Exception(act); Assert.NotNull(ex); Assert.IsType <MyException>(ex); }