コード例 #1
0
        public void GivenAValidTeacherAvailabilityIsReadyToBeSubmitted()
        {
            var availability        = new TimeSlotModel(IsoDayOfWeek.Monday, new LocalTimeModel(10, 0), new LocalTimeModel(22, 30));
            var teacherAvailability = new TeacherAvailabilityModel(availability.PutIntoList());

            ScenarioCache.Store(ModelKeys.TeacherAvailability, teacherAvailability);
        }
コード例 #2
0
        public void WhenThePassTemplateIsAttemptedToBeCreated()
        {
            var response = ApiCaller.Post <ActionReponse <PassTemplateModel> >(ScenarioCache.Get <PassTemplateModel>(ModelKeys.PassTemplate), Routes.PassTemplate);

            ScenarioCache.StoreActionResponse(response);
            ScenarioCache.Store(ModelIdKeys.PassTemplateId, response.Data.ActionResult.Id);
        }
コード例 #3
0
        public void WhenTheRoomIsAttemptedToBeCreated()
        {
            var response = ApiCaller.Post <ActionReponse <RoomModel> >(ScenarioCache.Get <RoomModel>(ModelKeys.Room), Routes.Room);

            ScenarioCache.StoreActionResponse(response);
            ScenarioCache.Store(ModelIdKeys.RoomId, response.Data.ActionResult.Id);
        }
コード例 #4
0
        public void ThenTheBlockClassCapacityIs(int classCapacity)
        {
            var block = ApiCaller.Get <BlockModel>(Routes.GetById(Routes.Blocks, ScenarioCache.GetId(ModelIdKeys.BlockId))).Data;

            Assert.AreEqual(classCapacity, block.ClassCapacity);
            ScenarioCache.Store(ModelKeys.Block, block);
        }
コード例 #5
0
        public void WhenTheCurrentUserIsRetrieved()
        {
            var response = ApiCaller.Get <UserModel>(Routes.GetCurrentUser);

            ScenarioCache.Store(ExpectedUserKey, response.Data);
            ScenarioCache.Store(ModelIdKeys.UserId, response.Data.Id);
        }
コード例 #6
0
        private static void RequestReport(string url)
        {
            var response = ApiCaller.Get <PassSalesResponse>(url);

            ScenarioCache.StoreResponse(response);
            ScenarioCache.Store(ModelKeys.PassSalesReport, response.Data);
        }
コード例 #7
0
        public void WhenTheStandAloneEventIsAttemptedToBeCreated()
        {
            var response = ApiCaller.Post <ActionReponse <StandAloneEventModel> >(ScenarioCache.Get <StandAloneEventModel>(ModelKeys.StandAloneEvent), Routes.StandAloneEvent);

            ScenarioCache.StoreActionResponse(response);
            ScenarioCache.Store(ModelIdKeys.StandAloneEventId, response.Data.ActionResult.Id);
        }
コード例 #8
0
 public static void SetupSystem()
 {
     ResetDatabase();
     ScenarioCache.Store(ModelIdKeys.UserId, 1);
     ScenarioCache.Store(ModelIdKeys.StudentIds, new List <int>());
     ScenarioCache.Store(ModelIdKeys.BlockIds, new List <int>());
 }
コード例 #9
0
        public void GivenThePassTemplateIsAnUnlimitedType()
        {
            var passTemplate = ScenarioCache.Get <PassTemplateModel>(ModelKeys.PassTemplate);

            passTemplate.PassType = PassType.Unlimited.ToString();

            ScenarioCache.Store(ModelKeys.PassTemplate, passTemplate);
        }
コード例 #10
0
        public void GivenTheStandAloneEventClassCapacityChangesTo(int classCapacity)
        {
            var standAloneEvent = ScenarioCache.Get <StandAloneEventModel>(ModelKeys.StandAloneEvent);

            standAloneEvent.ClassCapacity = classCapacity;

            ScenarioCache.Store(ModelKeys.StandAloneEvent, standAloneEvent);
        }
コード例 #11
0
        public void GivenTheStandAloneEventNeedsToBeChangedToPrivate()
        {
            var standAloneEvent = ScenarioCache.Get <StandAloneEventModel>(ModelKeys.StandAloneEvent);

            standAloneEvent.IsPrivate = true;

            ScenarioCache.Store(ModelKeys.StandAloneEvent, standAloneEvent);
        }
コード例 #12
0
        public void GivenAInvalidOpeningHourIsReadyToBeSubmitted()
        {
            var openingTime = new LocalTimeModel(10, 0);
            var closingTime = openingTime.PlusHours(-1);
            var openingHour = new TimeSlotModel(IsoDayOfWeek.Monday, openingTime, closingTime);

            ScenarioCache.Store(ModelKeys.OpeningHours, openingHour);
        }
コード例 #13
0
        public void GivenTheAnnouncementIsMissingTheSubject()
        {
            var announcement = ScenarioCache.Get <AnnouncementModel>(ModelKeys.Announcement);

            announcement.Subject = null;

            ScenarioCache.Store(ModelKeys.Announcement, announcement);
        }
コード例 #14
0
        public void GivenTheAnnouncementIsToBeSentToAllUsers()
        {
            var announcement = ScenarioCache.Get <AnnouncementModel>(ModelKeys.Announcement);

            announcement.NotifyAll = true;

            ScenarioCache.Store(ModelKeys.Announcement, announcement);
        }
コード例 #15
0
        public void GivenTheyProvideTheEmailAddress(string email)
        {
            var expectedUser = ScenarioCache.Get <UserModel>(ExpectedUserKey);

            expectedUser.Email = email;

            ScenarioCache.Store(ExpectedUserKey, expectedUser);
        }
コード例 #16
0
        public void GivenTheUserDoesntAgreeToTheTermsAndConditions()
        {
            var expectedUser = ScenarioCache.Get <UserModel>(ExpectedUserKey);

            expectedUser.AgreesToTerms = false;

            ScenarioCache.Store(ExpectedUserKey, expectedUser);
        }
コード例 #17
0
        public void GivenTheCurrentUserLeavesTheFirstNameEmpty()
        {
            var usernames = ScenarioCache.Get <UserNamesModel>(ModelKeys.UserNames);

            usernames.FirstName = null;

            ScenarioCache.Store(ModelKeys.UserNames, usernames);
        }
コード例 #18
0
        public void GivenAnInvalidTeacherRatesAreReadyToBeSubmitted()
        {
            var teacherRateSingle   = new SettingItemModel(SettingTypes.TeacherRateSolo.ToString().ToLower(), "invalid");
            var teacherRateMultiple = new SettingItemModel(SettingTypes.TeacherRatePartnered.ToString().ToLower(), "invalid");
            var completeSettings    = new CompleteSettingsModel(teacherRateSingle, teacherRateMultiple);

            ScenarioCache.Store(ModelKeys.CompleteSettings, completeSettings);
        }
コード例 #19
0
        public void GivenThePassNeedsToBeChanged()
        {
            var existingPass = ScenarioCache.Get <PassModel>(ModelKeys.Pass);

            existingPass.EndDate = existingPass.EndDate.AddMonths(1);

            ScenarioCache.Store(_updatedPassKey, existingPass);
        }
コード例 #20
0
        public void GivenTheNumberOfClassesInTheBlockIs(int numberOfClasses)
        {
            var block = ScenarioCache.Get <BlockModel>(ModelKeys.Block);

            block.NumberOfClasses = numberOfClasses;

            ScenarioCache.Store(ModelKeys.Block, block);
        }
コード例 #21
0
        public void GivenTheBlockClassCapacityIs(int classCapacity)
        {
            var block = ScenarioCache.Get <BlockModel>(ModelKeys.Block);

            block.ClassCapacity = classCapacity;

            ScenarioCache.Store(ModelKeys.Block, block);
        }
コード例 #22
0
        public void GivenTheBlockIsInviteOnly()
        {
            var block = ScenarioCache.Get <BlockModel>(ModelKeys.Block);

            block.IsInviteOnly = true;

            ScenarioCache.Store(ModelKeys.Block, block);
        }
コード例 #23
0
        public void GivenAValidLogoUrlIsReadyToBeSubmitted()
        {
            var validUri         = new Uri("http://www.allaccess.com/assets/img/editorial/raw/kr/KRfoundlogo.jpg");
            var logoSetting      = new SettingItemModel(SettingTypes.Logo.ToString().ToLower(), validUri.OriginalString);
            var completeSettings = new CompleteSettingsModel(logoSetting);

            ScenarioCache.Store(ModelKeys.SettingItem, logoSetting);
            ScenarioCache.Store(ModelKeys.CompleteSettings, completeSettings);
        }
コード例 #24
0
        public void GivenAValidTermsAndConditionsIsReadyToBeSubmitted()
        {
            var validTerms = "<p>something</p>";
            var termsAndConditionsSetting = new SettingItemModel("termsAndConditions", validTerms);
            var completeSettings          = new CompleteSettingsModel(termsAndConditionsSetting);

            ScenarioCache.Store(ModelKeys.SettingItem, termsAndConditionsSetting);
            ScenarioCache.Store(ModelKeys.CompleteSettings, completeSettings);
        }
コード例 #25
0
        public void GivenTheLogoSettingNeedsToBeChanged()
        {
            var validUri         = new Uri("http://mastiffpartyrentals.com/wp-content/uploads/2015/12/foo-fighters-logo-vector-5230292300-7bff484bd0-b.jpg");
            var logoSetting      = new SettingItemModel(SettingTypes.Logo.ToString().ToLower(), validUri.OriginalString);
            var completeSettings = new CompleteSettingsModel(logoSetting);

            ScenarioCache.Store(ModelKeys.SettingItem, logoSetting);
            ScenarioCache.Store(ModelKeys.CompleteSettings, completeSettings);
        }
コード例 #26
0
        private void SetSetting(SettingTypes type, string value)
        {
            var settingItem      = new SettingItemModel(type.ToString().ToLower(), value);
            var completeSettings = new CompleteSettingsModel(settingItem);

            ScenarioCache.Store(ModelKeys.CompleteSettings, completeSettings);
            WhenTheSettingsAreAttemptedToBeSet();
            new CommonSteps().ThenTheRequestIsSuccessful();
        }
コード例 #27
0
        public void GivenTheAnnouncementIsToBeSentToNoOne()
        {
            var announcement = ScenarioCache.Get <AnnouncementModel>(ModelKeys.Announcement);

            announcement.NotifyAll = false;
            announcement.Receivers = new List <BlockModel>();

            ScenarioCache.Store(ModelKeys.Announcement, announcement);
        }
コード例 #28
0
        public void GivenOpeningHoursNeedToBeChanged()
        {
            var response     = ApiCaller.Get <List <TimeSlotModel> >(Routes.OpeningHours);
            var openingHours = response.Data.Single();

            var newOpeningHours = new TimeSlotModel(openingHours.Day, openingHours.OpeningTime.PlusHours(1), openingHours.ClosingTime.PlusHours(1));

            ScenarioCache.Store(ModelKeys.OpeningHours, newOpeningHours);
        }
コード例 #29
0
        public void WhenTheNextBlockIsGenerated()
        {
            var response = ApiCaller.Post <ActionReponse <BlockModel> >(Routes.GetCreateNextBlock(ScenarioCache.GetId(ModelIdKeys.BlockId)));

            Assert.AreEqual(HttpStatusCode.Created, response.StatusCode);

            ScenarioCache.StoreActionResponse(response);
            ScenarioCache.Store(ModelIdKeys.BlockId, response.Data.ActionResult.Id);
        }
コード例 #30
0
        public void GivenThePendingBlockIsToBeHeldInTheRoom()
        {
            var block  = ScenarioCache.Get <BlockModel>(ModelKeys.Block);
            var roomId = ScenarioCache.GetId(ModelIdKeys.RoomId);

            block.Room = new RoomModel(roomId);

            ScenarioCache.Store(ModelKeys.Block, block);
        }