Esempio n. 1
0
        public void ThenTheUserSScheduleIsNotEmtpy()
        {
            var response = ScenarioCache.Get <RestResponse <List <EventModel> > >(ScheduleResponseKey);

            Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
            Assert.IsNotEmpty(response.Data);
        }
Esempio n. 2
0
        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())));
        }
Esempio n. 3
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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
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);
        }
Esempio n. 6
0
        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);
        }
Esempio n. 7
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);
        }
Esempio n. 8
0
        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);
        }
Esempio n. 11
0
        public void GivenTheyProvideTheEmailAddress(string email)
        {
            var expectedUser = ScenarioCache.Get <UserModel>(ExpectedUserKey);

            expectedUser.Email = email;

            ScenarioCache.Store(ExpectedUserKey, expectedUser);
        }
Esempio n. 12
0
        public void GivenTheUserDoesntAgreeToTheTermsAndConditions()
        {
            var expectedUser = ScenarioCache.Get <UserModel>(ExpectedUserKey);

            expectedUser.AgreesToTerms = false;

            ScenarioCache.Store(ExpectedUserKey, expectedUser);
        }
Esempio n. 13
0
        public void WhenUserIsAttemptedToBeCreated()
        {
            var expectedUser = ScenarioCache.Get <UserModel>(ExpectedUserKey);

            var userResponse = ApiCaller.Post <ActionReponse <UserModel> >(expectedUser, Routes.Users);

            ScenarioCache.StoreActionResponse(userResponse);
        }
Esempio n. 14
0
        public void WhenThePassIsUpdated()
        {
            var updatedPass = ScenarioCache.Get <PassModel>(_updatedPassKey);

            var restResponse = ApiCaller.Put <ActionReponse <PassModel> >(updatedPass, Routes.GetById("passes", updatedPass.Id));

            ScenarioCache.StoreResponse(restResponse);
        }
Esempio n. 15
0
        public void GivenThePassNeedsToBeChanged()
        {
            var existingPass = ScenarioCache.Get <PassModel>(ModelKeys.Pass);

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

            ScenarioCache.Store(_updatedPassKey, existingPass);
        }
Esempio n. 16
0
        public void GivenThePassTemplateIsAnUnlimitedType()
        {
            var passTemplate = ScenarioCache.Get <PassTemplateModel>(ModelKeys.PassTemplate);

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

            ScenarioCache.Store(ModelKeys.PassTemplate, passTemplate);
        }
Esempio n. 17
0
        public void GivenTheStandAloneEventClassCapacityChangesTo(int classCapacity)
        {
            var standAloneEvent = ScenarioCache.Get <StandAloneEventModel>(ModelKeys.StandAloneEvent);

            standAloneEvent.ClassCapacity = classCapacity;

            ScenarioCache.Store(ModelKeys.StandAloneEvent, standAloneEvent);
        }
Esempio n. 18
0
        public void GivenTheBlockClassCapacityIs(int classCapacity)
        {
            var block = ScenarioCache.Get <BlockModel>(ModelKeys.Block);

            block.ClassCapacity = classCapacity;

            ScenarioCache.Store(ModelKeys.Block, block);
        }
Esempio n. 19
0
        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);
        }
Esempio n. 20
0
        public void GivenTheNumberOfClassesInTheBlockIs(int numberOfClasses)
        {
            var block = ScenarioCache.Get <BlockModel>(ModelKeys.Block);

            block.NumberOfClasses = numberOfClasses;

            ScenarioCache.Store(ModelKeys.Block, block);
        }
Esempio n. 21
0
        public void WhenTheCurrentUserChangesTheirName()
        {
            var usernames = ScenarioCache.Get <UserNamesModel>(ModelKeys.UserNames);

            var response = ApiCaller.Put <ActionReponse <ActionReponse <UserModel> > >(usernames, Routes.CurrentUserNames);

            ScenarioCache.StoreActionResponse(response);
        }
Esempio n. 22
0
        public void GivenTheBlockIsInviteOnly()
        {
            var block = ScenarioCache.Get <BlockModel>(ModelKeys.Block);

            block.IsInviteOnly = true;

            ScenarioCache.Store(ModelKeys.Block, block);
        }
Esempio n. 23
0
        public void GivenTheCurrentUserLeavesTheFirstNameEmpty()
        {
            var usernames = ScenarioCache.Get <UserNamesModel>(ModelKeys.UserNames);

            usernames.FirstName = null;

            ScenarioCache.Store(ModelKeys.UserNames, usernames);
        }
Esempio n. 24
0
        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);
        }
Esempio n. 25
0
        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);
        }
Esempio n. 27
0
        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);
        }
Esempio n. 28
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);
        }
Esempio n. 29
0
        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);
        }