public ControllerContextBuilder <TContoller> BuildMission()
        {
            context.WithEntity(new Mission
            {
                Title = "Unit Test Mission",
                Id    = missionId
            });
            var level = new MissionLevel
            {
                AwardTitle = awardTitle,
                Id         = missionLevelId,
                Level      = missionLevel,
                Name       = missionName,
                Tracks     = tracks,
                MissionId  = missionId
            };

            foreach (var track in tracks)
            {
                context.WithEntity(track.Badge);
                foreach (var challenge in track.Challenges)
                {
                    // Make sure the challenges are attached to this track and added to the dataset.
                    challenge.MissionTrackId = track.Id;
                    context.WithEntity(challenge);
                }
                track.MissionLevelId = missionLevelId;
                context.WithEntity(track);
            }
            context.WithEntity(level);
            return(context);
        }
示例#2
0
        public ControllerContextBuilder <TController> BuildObservation()
        {
            var observation = new Observation
            {
                Id                     = observationId,
                ChallengeId            = challengeId,
                Equipment              = equipment,
                ExpectedImage          = expectedImage,
                Notes                  = notes,
                ObservationDateTimeUtc = observationDateTimeUtc,
                ObservingSite          = observingSite,
                Seeing                 = seeing,
                Status                 = observationStatus,
                SubmittedImage         = submittedImage,
                Transparency           = transparency,
                UserId                 = userId
            };

            context.WithEntity(observation);
            return(context);
        }