Пример #1
0
        public static CoursesCounter Random()
        {
            List <CourseId> existingCourses = ListMother <CourseId> .Random(CourseIdMother.Random);

            return(Create(
                       CoursesCounterIdMother.Random(),
                       CoursesCounterTotalMother.Create(existingCourses.Count),
                       existingCourses
                       ));
        }
Пример #2
0
        public static CoursesCounter Incrementing(CoursesCounter existingCounter, CourseId courseId)
        {
            List <CourseId> existingCourses = new List <CourseId>(existingCounter.ExistingCourses);

            existingCourses.Add(courseId);

            return(Create(
                       existingCounter.Id,
                       CoursesCounterTotalMother.Create(existingCounter.Total.Value + 1),
                       existingCourses
                       ));
        }
Пример #3
0
 public static CoursesCounter WithOne(CourseId courseId)
 {
     return(Create(CoursesCounterIdMother.Random(), CoursesCounterTotalMother.One(), ListMother <CourseId> .One(courseId)));
 }