private async Task <ApiLessonResponseModel> CreateRecord()
        {
            var model = new ApiLessonRequestModel();

            model.SetProperties(DateTime.Parse("1/1/1988 12:00:00 AM"), DateTime.Parse("1/1/1988 12:00:00 AM"), 2m, 1, DateTime.Parse("1/1/1988 12:00:00 AM"), DateTime.Parse("1/1/1988 12:00:00 AM"), "B", 1, "B");
            CreateResponse <ApiLessonResponseModel> result = await this.Client.LessonCreateAsync(model);

            result.Success.Should().BeTrue();
            return(result.Record);
        }
示例#2
0
        public void MapModelToBO()
        {
            var mapper = new BOLLessonMapper();
            ApiLessonRequestModel model = new ApiLessonRequestModel();

            model.SetProperties(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");
            BOLesson response = mapper.MapModelToBO(1, 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");
        }
        public void CreatePatch()
        {
            var mapper = new ApiLessonModelMapper();
            var model  = new ApiLessonRequestModel();

            model.SetProperties(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");

            JsonPatchDocument <ApiLessonRequestModel> patch = mapper.CreatePatch(model);
            var response = new ApiLessonRequestModel();

            patch.ApplyTo(response);
            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");
        }