Пример #1
0
        public void MapResponseToRequest()
        {
            var mapper = new ApiLessonModelMapper();
            var model  = new ApiLessonResponseModel();

            model.SetProperties(1, DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), 1m, 1, DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), "A", 1, "A");
            ApiLessonRequestModel response = mapper.MapResponseToRequest(model);

            response.ActualEndDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.ActualStartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.BillAmount.Should().Be(1m);
            response.LessonStatusId.Should().Be(1);
            response.ScheduledEndDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.ScheduledStartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.StudentNotes.Should().Be("A");
            response.StudioId.Should().Be(1);
            response.TeacherNotes.Should().Be("A");
        }
Пример #2
0
        public async void TestUpdate()
        {
            var model = await this.CreateRecord();

            ApiLessonModelMapper mapper = new ApiLessonModelMapper();

            UpdateResponse <ApiLessonResponseModel> updateResponse = await this.Client.LessonUpdateAsync(model.Id, mapper.MapResponseToRequest(model));

            updateResponse.Record.Should().NotBeNull();
            updateResponse.Success.Should().BeTrue();

            await this.Cleanup();
        }