private TeacherModel CreateNewTeacher()
        {
            new CommonTeacherSteps().GivenAnExistingUserIsATeacher();
            var id = ScenarioCache.GetTeacherId();

            return(new TeacherModel(id));
        }
Beispiel #2
0
        public void GivenAnInvalidStandAloneEventIsReadyToBeSubmitted()
        {
            new CommonTeacherSteps().GivenAnExistingUserIsATeacher();

            var standAloneEvent = new StandAloneEventModel
            {
                Teachers = new TeacherModel {
                    Id = ScenarioCache.GetTeacherId()
                }.PutIntoList(),
                StartTime = DateTime.Now.AddHours(1),
                EndTime   = DateTime.Now.AddHours(3),
            };

            ScenarioCache.Store(ModelKeys.StandAloneEvent, standAloneEvent);
        }
        public void GivenATeacherIsTeachingASoloBlockAndAPartneredBlock()
        {
            GivenABlockWithClassesExists(2);
            var mainTeacher = new TeacherModel(ScenarioCache.GetTeacherId());

            GivenABlockWithClassesExists(2);
            var secondTeacher = new TeacherModel(ScenarioCache.GetTeacherId());

            var teachers = new List <TeacherModel>
            {
                mainTeacher,
                secondTeacher
            };

            new UpdateBlockSteps().SetTeachersForBlock(teachers);
        }
Beispiel #4
0
        public void GivenAValidStandAloneEventIsReadyToBeSubmitted()
        {
            new CommonTeacherSteps().GivenAnExistingUserIsATeacher();

            var standAloneEvent = new StandAloneEventModel
            {
                Name          = "Private Lesson",
                Price         = 80,
                ClassCapacity = 30,
                Teachers      = new TeacherModel {
                    Id = ScenarioCache.GetTeacherId()
                }.PutIntoList(),
                StartTime   = DateTime.Now.AddDays(2).AddHours(1),
                EndTime     = DateTime.Now.AddDays(2).AddHours(3),
                TeacherRate = 100
            };

            ScenarioCache.Store(ModelKeys.StandAloneEvent, standAloneEvent);
        }
Beispiel #5
0
        public void GivenAValidBlockIsReadyToBeSubmitted()
        {
            new CommonTeacherSteps().GivenAnExistingUserIsATeacher();

            var startDate = DateTime.Now.Date.AddDays(2);

            startDate = startDate.AddHours(11);
            var startDateWithOffset = new DateTimeOffset(startDate);
            var block = new BlockModel
            {
                MinutesPerClass = 60,
                NumberOfClasses = 6,
                ClassCapacity   = 30,
                Name            = "Charleston Level 1",
                StartDate       = startDateWithOffset,
                Teachers        = new TeacherModel {
                    Id = ScenarioCache.GetTeacherId()
                }.PutIntoList()
            };

            ScenarioCache.Store(ModelKeys.Block, block);
        }
        public void ThenUserIsAddedToTheListOfTeachers()
        {
            var allTeachersResponse = ApiCaller.Get <TeacherModel>(Routes.GetTeacherById(ScenarioCache.GetTeacherId()));

            Assert.AreEqual(HttpStatusCode.OK, allTeachersResponse.StatusCode);
        }
Beispiel #7
0
        public void WhenTeacherIsRemoved()
        {
            var response = ApiCaller.Delete <bool>(Routes.GetTeacherById(ScenarioCache.GetTeacherId()));

            Assert.AreEqual(HttpStatusCode.OK, response.StatusCode);
        }