public void ShouldThrowArgumentNullExceptionWhenAddNewSkillGoalIfSkillEvaluatorIsNull() { // arrange var evaluation = new Evaluation(new Employee(101, "John Doe").Evaluatee, new EvaluationPeriod(TimeZoneInfo.Local, new DateTime(DateTime.Today.Year, 1, 1), new DateTime(DateTime.Today.Year, 12, 31))); var skill = new Skill("C#"); var targetSkillLevel = SkillLevel.Advanced; var currentSkillLevel = SkillLevel.Average; // act void action() => evaluation.AddNewSkillGoal(skill, null, targetSkillLevel, currentSkillLevel); // assert Assert.Throws <ArgumentNullException>(action); }
public void ShouldAddNewSkillGoal() { // arrange var evaluation = new Evaluation(new Employee(101, "John Doe").Evaluatee, new EvaluationPeriod(TimeZoneInfo.Local, new DateTime(DateTime.Today.Year, 1, 1), new DateTime(DateTime.Today.Year, 12, 31))); var skill = new Skill("C#"); var skillEvaluator = new Employee(100, "Jane Doe").SkillEvaluator; var targetSkillLevel = SkillLevel.Advanced; var currentSkillLevel = SkillLevel.Average; // act var result = evaluation.AddNewSkillGoal(skill, skillEvaluator, targetSkillLevel, currentSkillLevel); // assert Assert.Equal(OperationStatusCode.Success, result.OperationStatusCode); Assert.Single(evaluation.SkillGoals); }