public void ThenTheUserSScheduleIsNotEmtpy() { var response = ScenarioCache.Get <RestResponse <List <EventModel> > >(ScheduleResponseKey); Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); Assert.IsNotEmpty(response.Data); }
public void ThenTheirClaimsAre(List <string> expectedClaims) { var response = ScenarioCache.Get <RestResponse <List <string> > >(ClaimsResponseKey); Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); Assert.IsTrue(expectedClaims.Select(x => x.ToLower()).HasSameItems(response.Data.Select(x => x.ToLower()))); }
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 WhenTheBlockIsUpdated() { var response = ApiCaller.Put <ActionReponse <BlockModel> >(ScenarioCache.Get <BlockModel>(ModelKeys.Block), Routes.GetById(Routes.Blocks, ScenarioCache.GetId(ModelIdKeys.BlockId))); ScenarioCache.StoreActionResponse(response); }
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 void WhenTheClassIsUpdated() { var response = ApiCaller.Put <ActionReponse <ClassModel> >(ScenarioCache.Get <ClassModel>(ModelKeys.Class), Routes.GetById(Routes.Classes, ScenarioCache.GetId(ModelIdKeys.ClassId))); ScenarioCache.StoreActionResponse(response); }
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 GivenTheStandAloneEventNeedsToBeChangedToPrivate() { var standAloneEvent = ScenarioCache.Get <StandAloneEventModel>(ModelKeys.StandAloneEvent); standAloneEvent.IsPrivate = true; ScenarioCache.Store(ModelKeys.StandAloneEvent, standAloneEvent); }
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 WhenUserIsAttemptedToBeCreated() { var expectedUser = ScenarioCache.Get <UserModel>(ExpectedUserKey); var userResponse = ApiCaller.Post <ActionReponse <UserModel> >(expectedUser, Routes.Users); ScenarioCache.StoreActionResponse(userResponse); }
public void WhenThePassIsUpdated() { var updatedPass = ScenarioCache.Get <PassModel>(_updatedPassKey); var restResponse = ApiCaller.Put <ActionReponse <PassModel> >(updatedPass, Routes.GetById("passes", updatedPass.Id)); ScenarioCache.StoreResponse(restResponse); }
public void GivenThePassNeedsToBeChanged() { var existingPass = ScenarioCache.Get <PassModel>(ModelKeys.Pass); existingPass.EndDate = existingPass.EndDate.AddMonths(1); ScenarioCache.Store(_updatedPassKey, existingPass); }
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 GivenTheBlockClassCapacityIs(int classCapacity) { var block = ScenarioCache.Get <BlockModel>(ModelKeys.Block); block.ClassCapacity = classCapacity; ScenarioCache.Store(ModelKeys.Block, block); }
private static ClassDetailLine GetLine(int lineNumber) { var report = ScenarioCache.Get <BlockDetailsResponse>(ModelKeys.BlockDetailsReport); var line = report.Lines.Skip(lineNumber - 1).Take(1).Single(); return(line); }
public void GivenTheNumberOfClassesInTheBlockIs(int numberOfClasses) { var block = ScenarioCache.Get <BlockModel>(ModelKeys.Block); block.NumberOfClasses = numberOfClasses; ScenarioCache.Store(ModelKeys.Block, block); }
public void WhenTheCurrentUserChangesTheirName() { var usernames = ScenarioCache.Get <UserNamesModel>(ModelKeys.UserNames); var response = ApiCaller.Put <ActionReponse <ActionReponse <UserModel> > >(usernames, Routes.CurrentUserNames); ScenarioCache.StoreActionResponse(response); }
public void GivenTheBlockIsInviteOnly() { var block = ScenarioCache.Get <BlockModel>(ModelKeys.Block); block.IsInviteOnly = true; ScenarioCache.Store(ModelKeys.Block, block); }
public void GivenTheCurrentUserLeavesTheFirstNameEmpty() { var usernames = ScenarioCache.Get <UserNamesModel>(ModelKeys.UserNames); usernames.FirstName = null; ScenarioCache.Store(ModelKeys.UserNames, usernames); }
public void WhenTheClassTeachersAreChanged() { var classId = ScenarioCache.GetId(ModelIdKeys.ClassId); var response = ApiCaller.Put <ActionReponse <ClassModel> >(ScenarioCache.Get <List <int> >(NewTeacherIdsKey), Routes.GetChangeClassTeachers(ScenarioCache.GetId(ModelIdKeys.ClassId))); ScenarioCache.StoreActionResponse(response); }
public void ThenTheClassSStartAndEndTimeIsUpdated() { var classModel = ApiCaller.Get <ClassModel>(Routes.GetById(Routes.Classes, ScenarioCache.GetId(ModelIdKeys.ClassId))).Data; var expectedClassModel = ScenarioCache.Get <ClassModel>(ModelKeys.Class); Assert.AreEqual(expectedClassModel.StartTime, classModel.StartTime); Assert.AreEqual(expectedClassModel.EndTime, classModel.EndTime); }
public void GivenTheAnnouncementIsToBeSentToTheBlock() { var announcement = ScenarioCache.Get <AnnouncementModel>(ModelKeys.Announcement); announcement.NotifyAll = false; announcement.Receivers = new BlockModel(1).PutIntoList(); ScenarioCache.Store(ModelKeys.Announcement, announcement); }
public void ThenTheCorrectNumberOfClassesAreCreated() { var response = ApiCaller.Get <BlockModel>(Routes.GetById(Routes.Blocks, ScenarioCache.GetId(ModelIdKeys.BlockId))); var block = response.Data; var expectedBlock = ScenarioCache.Get <BlockModel>(ModelKeys.Block); Assert.AreEqual(expectedBlock.NumberOfClasses, block.Classes.Count); }
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); }
public void ThenTheCurrentUsersNameIsUnchanged() { var response = ApiCaller.Get <UserNamesModel>(Routes.CurrentUserNames); var expectedNames = ScenarioCache.Get <UserNamesModel>(ModelKeys.UserNames); Assert.IsNull(response.Data.FirstName); Assert.IsNull(response.Data.Surname); }
public void GivenTheAnnouncementIsToBeSentToNoOne() { var announcement = ScenarioCache.Get <AnnouncementModel>(ModelKeys.Announcement); announcement.NotifyAll = false; announcement.Receivers = new List <BlockModel>(); ScenarioCache.Store(ModelKeys.Announcement, announcement); }