public void GetDifficulties() { ProjectConfig config = new ProjectConfig(); IList<TaskDifficulty> difficulties; #region StrDifficulties is null difficulties = config.GetDifficulties(); Assert.That(difficulties.Count, Is.EqualTo(5)); Assert.That(difficulties.Contains(TaskDifficulty.Easiest)); Assert.That(difficulties.Contains(TaskDifficulty.Easy)); Assert.That(difficulties.Contains(TaskDifficulty.Common)); Assert.That(difficulties.Contains(TaskDifficulty.Hard)); Assert.That(difficulties.Contains(TaskDifficulty.Hardest)); #endregion #region StrDifficulties not null config.SetDifficulties( new List<TaskDifficulty> { TaskDifficulty.Easy, TaskDifficulty.Hard }); difficulties = config.GetDifficulties(); Assert.That(difficulties.Count, Is.EqualTo(2)); Assert.That(difficulties.Contains(TaskDifficulty.Easy)); Assert.That(difficulties.Contains(TaskDifficulty.Hard)); #endregion }
public void SetDifficulties() { ProjectConfig config = new ProjectConfig(); var difficulties = new List<TaskDifficulty> { TaskDifficulty.Easy, TaskDifficulty.Hard }; config.SetDifficulties(difficulties); var result_difficulties = config.GetDifficulties(); Assert.That(result_difficulties.Count, Is.EqualTo(2)); Assert.That(result_difficulties.Contains(TaskDifficulty.Easy)); Assert.That(result_difficulties.Contains(TaskDifficulty.Hard)); }