public void MapResponseToRequest() { var mapper = new ApiLessonStatusModelMapper(); var model = new ApiLessonStatusResponseModel(); model.SetProperties(1, "A", 1); ApiLessonStatusRequestModel response = mapper.MapResponseToRequest(model); response.Name.Should().Be("A"); response.StudioId.Should().Be(1); }
public async void TestUpdate() { var model = await this.CreateRecord(); ApiLessonStatusModelMapper mapper = new ApiLessonStatusModelMapper(); UpdateResponse <ApiLessonStatusResponseModel> updateResponse = await this.Client.LessonStatusUpdateAsync(model.Id, mapper.MapResponseToRequest(model)); updateResponse.Record.Should().NotBeNull(); updateResponse.Success.Should().BeTrue(); await this.Cleanup(); }
public void CreatePatch() { var mapper = new ApiLessonStatusModelMapper(); var model = new ApiLessonStatusRequestModel(); model.SetProperties("A", 1); JsonPatchDocument <ApiLessonStatusRequestModel> patch = mapper.CreatePatch(model); var response = new ApiLessonStatusRequestModel(); patch.ApplyTo(response); response.Name.Should().Be("A"); response.StudioId.Should().Be(1); }