示例#1
0
        private static Challenge CreateChallenge(List <User> usersToGrabParticipantsAndReviewersFrom)
        {
            var numberOfParticipantsToCreate = _randomGenerator.Next(Math.Min(usersToGrabParticipantsAndReviewersFrom.Count, 5), Math.Min(usersToGrabParticipantsAndReviewersFrom.Count, 10));
            var numberOfReviewersToCreate    = _randomGenerator.Next(1, Math.Min(usersToGrabParticipantsAndReviewersFrom.Count, 5));
            var participants = usersToGrabParticipantsAndReviewersFrom.GetRandomUsers(numberOfParticipantsToCreate);
            var reviewers    = usersToGrabParticipantsAndReviewersFrom.GetRandomUsers(numberOfReviewersToCreate);
            var challengeId  = IdProvider.GetNextChallengeId();

            return(new Challenge(challengeId, challengeId.GetName("Challenge"), participants, reviewers));
        }
示例#2
0
        private static Presentation CreatePresentation()
        {
            int numberOfSlidesToCreate = _randomGenerator.Next(1, 10);
            var slides = Enumerable.Range(1, numberOfSlidesToCreate)
                         .Select(order => CreateSlide(order))
                         .ToList();

            var presentationId = IdProvider.GetNextPresentationId();

            return(new Presentation(presentationId, presentationId.GetName("Presentation"), slides));
        }
示例#3
0
        private static Company CreateCompany()
        {
            var numberOfUsersToCreate = _randomGenerator.Next(20, 40);
            var users = CreateUsers(numberOfUsersToCreate);

            var numberOfHeadCoachesToCreate = _randomGenerator.Next(1, Math.Min(5, users.Count));
            var headCoaches = CreateHeadCoaches(numberOfHeadCoachesToCreate, users, 10);

            var numberOfContentAuthorsToCreate = _randomGenerator.Next(1, Math.Min(10, users.Count));
            var contentAuthors = CreateContentAuthors(numberOfContentAuthorsToCreate, users, 20);

            var numberOfCourseAuthorsToCreate = _randomGenerator.Next(1, Math.Min(10, users.Count));
            var courseAuthors = CreateCourseAuthors(numberOfCourseAuthorsToCreate, users, 20);

            var companyId = IdProvider.GetNextCompanyId();

            return(new Company(companyId, companyId.GetName("Company"), users, headCoaches, contentAuthors, courseAuthors));
        }
示例#4
0
        private static User CreateUser()
        {
            var userId = IdProvider.GetNextUserId();

            return(new User(userId, userId.GetName("Firstname"), userId.GetName("Lastname"), userId.GetName("Login"), null, null, null, null));
        }
示例#5
0
        private static Slide CreateSlide(int slideOrder)
        {
            var slideId = IdProvider.GetNextSlideId();

            return(new Slide(slideId, slideOrder.GetName("Slide"), slideOrder));
        }