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()); }
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); }
public VerifyTeacherRateProperties(TeacherRateModel expected, TeacherRateModel actual) { _expected = expected; _actual = actual; }