public void WhenUserIsAttemptedToBeSetUpAsATeacher() { var userId = ScenarioCache.GetUserId(); var response = ApiCaller.Post <ActionReponse <TeacherModel> >(Routes.GetTeacherById(userId)); ScenarioCache.StoreActionResponse(response); }
public void GivenTheUserDoesWantToReceiveEmails() { var response = ApiCaller.Delete <ActionReponse <UserModel> >( Routes.GetDoNotEmailUser(ScenarioCache.GetUserId())); Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); }
public void ThenTheUsersDetailsCanNotBeRetrieved() { var userResponse = ApiCaller.Get <List <UserModel> >(Routes.Users); Assert.AreEqual(HttpStatusCode.OK, userResponse.StatusCode); Assert.IsEmpty(userResponse.Data.Where(x => x.Id == ScenarioCache.GetUserId())); }
public void ThenUserStillExists() { var allUsers = UserFunction.GetAllUsers(); var matchingUser = allUsers.SingleWithId(ScenarioCache.GetUserId()); Assert.IsNotNull(matchingUser); }
public void ThenTheUsersTermAndConditionsAgreementIsRecorded() { var userId = ScenarioCache.GetUserId(); var response = ApiCaller.Get <UserModel>(Routes.GetUserById(userId)); Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); Assert.IsTrue(response.Data.AgreesToTerms); }
public void GivenABlockExistsThatIsFull() { GivenABlockExistsWithAStudentLimitOf(1); var userId = ScenarioCache.GetUserId(); GivenTheUserEnrolsInTheBlock(); ScenarioCache.Store(ModelIdKeys.UserId, userId); }
public void ThenTheUserSDetailsCanBeRetrieved() { var userResponse = ApiCaller.Get <List <UserModel> >(Routes.Users); Assert.AreEqual(HttpStatusCode.OK, userResponse.StatusCode); var createdUser = userResponse.Data.SingleWithId(ScenarioCache.GetUserId()); var expectedUser = ScenarioCache.Get <UserModel>(ExpectedUserKey); new VerifyUserProperties(expectedUser, createdUser) .Verify(); }
public void WhenTheUserPurchasesAPassThatDoesntExistFromATeacher() { var pass = new PassModel { PaymentStatus = PassPaymentStatus.Paid.ToString() }; var url = Routes.GetPassPurchase(ScenarioCache.GetUserId(), 2); var response = ApiCaller.Post <ActionReponse <UserModel> >(pass, url); ScenarioCache.StoreActionResponse(response); }
private static void BuyPass() { new CommonUserSteps().GivenAUserExists(); var userId = ScenarioCache.GetUserId(); var studentIds = ScenarioCache.Get <List <int> >(ModelIdKeys.StudentIds); studentIds.Add(userId); ScenarioCache.Store(ModelIdKeys.StudentIds, studentIds); var purchasePassSteps = new PurchasePassSteps(); purchasePassSteps.WhenTheUserPurchasesAPassFromATeacher(); purchasePassSteps.ThenTheUserHasAPass(); purchasePassSteps.ThenThePassIsPaid(); purchasePassSteps.ThenThePassIsValid(); }
public void WhenTheUserTriesToEnrolInTheBlock() { var response = ApiCaller.Post <ActionReponse <UserModel> >(new EnrolmentModel(ScenarioCache.GetId(ModelIdKeys.BlockId)), Routes.GetEnrolUserInBlock(ScenarioCache.GetUserId())); ScenarioCache.StoreActionResponse(response); }
public void WhenTheUserPurchasesAPassFromATeacher() { var pass = new PassModel { PaymentStatus = PassPaymentStatus.Paid.ToString() }; var response = ApiCaller.Post <ActionReponse <UserModel> >(pass, Routes.GetPassPurchase(ScenarioCache.GetUserId(), ScenarioCache.GetId(ModelIdKeys.PassTemplateId))); Assert.AreEqual(HttpStatusCode.Created, response.StatusCode); }
public void WhenTheUserRegistersForTheStandAloneEvent() { var response = ApiCaller.Post <ActionReponse <UserModel> >(new EventRegistrationModel(ScenarioCache.GetId(ModelIdKeys.StandAloneEventId)), Routes.GetRegisterUserInEvent(ScenarioCache.GetUserId())); Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); }
public void GivenTheUserEnrolsInBlocks(int numberOfBlocks) { for (int blockId = 1; blockId <= numberOfBlocks; blockId++) { var response = ApiCaller.Post <ActionReponse <UserModel> >(new EnrolmentModel(blockId), Routes.GetEnrolUserInBlock(ScenarioCache.GetUserId())); Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); } }
public void GivenTheUserEnrolsInTheBlock() { var response = ApiCaller.Post <ActionReponse <UserModel> >(new EnrolmentModel(ScenarioCache.GetId(ModelIdKeys.BlockId)), Routes.GetEnrolUserInBlock(ScenarioCache.GetUserId())); Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); }
public void WhenTheirClaimsAreRetrieved() { var response = ApiCaller.Get <List <string> >(Routes.GetUserClaims(ScenarioCache.GetUserId())); ScenarioCache.Store(ClaimsResponseKey, response); }
public void WhenTheUserScheduleIsRetrieved() { var response = ApiCaller.Get <List <EventModel> >(Routes.GetUserSchedule(ScenarioCache.GetUserId())); ScenarioCache.Store(ScheduleResponseKey, response); }
public void WhenTheUserIsDeleted() { var response = ApiCaller.Delete <UserModel>(Routes.GetById(Routes.Users, ScenarioCache.GetUserId())); ScenarioCache.StoreResponse(response); }