public void CanAddMultipleDistinctSkillsToUserAccount() { var skill = new FakeSkill(1, "Fake skill 1"); var otherSkill = new FakeSkill(2, "Fake skill 2"); var sut = new UserAccount(); sut.AddSkill(skill, FakeSkillLevel.Default); sut.AddSkill(otherSkill, FakeSkillLevel.Default); sut.Skills.Count.Should().Be(2); }
public void CannotAssignSameSkillTwice() { var skill = FakeSkill.Default; var level = FakeSkillLevel.Default; var sut = new UserAccount(); sut.AddSkill(skill, level); sut.AddSkill(skill, level); sut.Skills.Count.Should().Be(1); sut.Skills.SingleOrDefault(o => o.Skill.Id.Equals(skill.Id) && o.Level.Id.Equals(level.Id) ).Should().NotBeNull(); }
public void IfUserHasSkillThenUpdateLevel() { var skill = FakeSkill.Default; var oldLevel = FakeSkillLevel.Default; var newLevel = new FakeSkillLevel(100, "New fake level"); var sut = new UserAccount(); sut.AddSkill(skill, oldLevel); sut.AddSkill(skill, newLevel); sut.Skills.Count.Should().Be(1); sut.Skills.SingleOrDefault(o => o.Skill.Id.Equals(skill.Id) && o.Level.Id.Equals(oldLevel.Id) ).Should().BeNull(); sut.Skills.SingleOrDefault(o => o.Skill.Id.Equals(skill.Id) && o.Level.Id.Equals(newLevel.Id) ).Should().NotBeNull(); }