-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathModuleRepository.cs
More file actions
44 lines (41 loc) · 1.21 KB
/
ModuleRepository.cs
File metadata and controls
44 lines (41 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System.Collections.Generic;
using System.Linq;
using WriteUnitTest.Entities;
using WriteUnitTest.Interfaces;
namespace WriteUnitTest.Repositories
{
public class ModuleRepository: IModuleRepository
{
private readonly List<Module> moduleList;
public ModuleRepository()
{
moduleList = new List<Module>
{
new Module
{
ModuleId = 873,
MinimumPassingGrade = 80,
Lessons = new List<Lesson>
{
new Lesson
{
LessonId = 12,
Grade = 63.7d,
IsPassed = false
},
new Lesson
{
LessonId = 86,
Grade = 88.2d,
IsPassed = true
}
}
}
};
}
public Module GetModule(int lessonId)
{
return moduleList.FirstOrDefault(x => x.Lessons.Any(y => y.LessonId == lessonId));
}
}
}