Esempio n. 1
0
        public static CoursesCounter Random()
        {
            List <CourseId> existingCourses = ListMother <CourseId> .Random(CourseIdMother.Random);

            return(Create(
                       CoursesCounterIdMother.Random(),
                       CoursesCounterTotalMother.Create(existingCourses.Count),
                       existingCourses
                       ));
        }
Esempio n. 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
                       ));
        }