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); }
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); }
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); }
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); }
public void WhenTheCurrentUserIsRetrieved() { var response = ApiCaller.Get <UserModel>(Routes.GetCurrentUser); ScenarioCache.Store(ExpectedUserKey, response.Data); ScenarioCache.Store(ModelIdKeys.UserId, response.Data.Id); }
private static void RequestReport(string url) { var response = ApiCaller.Get <PassSalesResponse>(url); ScenarioCache.StoreResponse(response); ScenarioCache.Store(ModelKeys.PassSalesReport, response.Data); }
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); }
public static void SetupSystem() { ResetDatabase(); ScenarioCache.Store(ModelIdKeys.UserId, 1); ScenarioCache.Store(ModelIdKeys.StudentIds, new List <int>()); ScenarioCache.Store(ModelIdKeys.BlockIds, new List <int>()); }
public void GivenThePassTemplateIsAnUnlimitedType() { var passTemplate = ScenarioCache.Get <PassTemplateModel>(ModelKeys.PassTemplate); passTemplate.PassType = PassType.Unlimited.ToString(); ScenarioCache.Store(ModelKeys.PassTemplate, passTemplate); }
public void GivenTheStandAloneEventClassCapacityChangesTo(int classCapacity) { var standAloneEvent = ScenarioCache.Get <StandAloneEventModel>(ModelKeys.StandAloneEvent); standAloneEvent.ClassCapacity = classCapacity; ScenarioCache.Store(ModelKeys.StandAloneEvent, standAloneEvent); }
public void GivenTheStandAloneEventNeedsToBeChangedToPrivate() { var standAloneEvent = ScenarioCache.Get <StandAloneEventModel>(ModelKeys.StandAloneEvent); standAloneEvent.IsPrivate = true; ScenarioCache.Store(ModelKeys.StandAloneEvent, standAloneEvent); }
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); }
public void GivenTheAnnouncementIsMissingTheSubject() { var announcement = ScenarioCache.Get <AnnouncementModel>(ModelKeys.Announcement); announcement.Subject = null; ScenarioCache.Store(ModelKeys.Announcement, announcement); }
public void GivenTheAnnouncementIsToBeSentToAllUsers() { var announcement = ScenarioCache.Get <AnnouncementModel>(ModelKeys.Announcement); announcement.NotifyAll = true; ScenarioCache.Store(ModelKeys.Announcement, announcement); }
public void GivenTheyProvideTheEmailAddress(string email) { var expectedUser = ScenarioCache.Get <UserModel>(ExpectedUserKey); expectedUser.Email = email; ScenarioCache.Store(ExpectedUserKey, expectedUser); }
public void GivenTheUserDoesntAgreeToTheTermsAndConditions() { var expectedUser = ScenarioCache.Get <UserModel>(ExpectedUserKey); expectedUser.AgreesToTerms = false; ScenarioCache.Store(ExpectedUserKey, expectedUser); }
public void GivenTheCurrentUserLeavesTheFirstNameEmpty() { var usernames = ScenarioCache.Get <UserNamesModel>(ModelKeys.UserNames); usernames.FirstName = null; ScenarioCache.Store(ModelKeys.UserNames, usernames); }
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); }
public void GivenThePassNeedsToBeChanged() { var existingPass = ScenarioCache.Get <PassModel>(ModelKeys.Pass); existingPass.EndDate = existingPass.EndDate.AddMonths(1); ScenarioCache.Store(_updatedPassKey, existingPass); }
public void GivenTheNumberOfClassesInTheBlockIs(int numberOfClasses) { var block = ScenarioCache.Get <BlockModel>(ModelKeys.Block); block.NumberOfClasses = numberOfClasses; ScenarioCache.Store(ModelKeys.Block, block); }
public void GivenTheBlockClassCapacityIs(int classCapacity) { var block = ScenarioCache.Get <BlockModel>(ModelKeys.Block); block.ClassCapacity = classCapacity; ScenarioCache.Store(ModelKeys.Block, block); }
public void GivenTheBlockIsInviteOnly() { var block = ScenarioCache.Get <BlockModel>(ModelKeys.Block); block.IsInviteOnly = true; ScenarioCache.Store(ModelKeys.Block, block); }
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); }
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); }
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); }
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(); }
public void GivenTheAnnouncementIsToBeSentToNoOne() { var announcement = ScenarioCache.Get <AnnouncementModel>(ModelKeys.Announcement); announcement.NotifyAll = false; announcement.Receivers = new List <BlockModel>(); ScenarioCache.Store(ModelKeys.Announcement, announcement); }
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); }
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); }
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); }