public IHttpActionResult Post(int id, [FromBody] TeacherRateModel model)
        {
            var teacher = new Teacher(id);

            teacher.Rate = model.ToEntity();

            var result = PerformAction <UpdateTeacherRate, Teacher>(new UpdateTeacherRate(teacher));

            return(new ActionResultToCreatedHttpActionResult <Teacher, TeacherModel>(result, x => x.ToModel(), this)
                   .Do());
        }
Пример #2
0
        public void WhenTheRateForTheTeacherIsChanged()
        {
            var rate = new TeacherRateModel(100, 200);

            ScenarioCache.Store(ModelKeys.TeacherRate, rate);

            var teacherId = ScenarioCache.GetId(ModelIdKeys.TeacherId);
            var url       = Routes.GetTeacherRatesById(teacherId);

            var response = ApiCaller.Post <ActionReponse <TeacherModel> >(rate, url);

            ScenarioCache.StoreActionResponse(response);
        }
Пример #3
0
 public VerifyTeacherRateProperties(TeacherRateModel expected, TeacherRateModel actual)
 {
     _expected = expected;
     _actual   = actual;
 }