Ejemplo n.º 1
0
        public void MapBOToModelList()
        {
            var      mapper = new BOLLessonMapper();
            BOLesson bo     = new BOLesson();

            bo.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");
            List <ApiLessonResponseModel> response = mapper.MapBOToModel(new List <BOLesson>()
            {
                { bo }
            });

            response.Count.Should().Be(1);
        }
Ejemplo n.º 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");
        }
Ejemplo n.º 3
0
        public void MapBOToModel()
        {
            var      mapper = new BOLLessonMapper();
            BOLesson bo     = new BOLesson();

            bo.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");
            ApiLessonResponseModel response = mapper.MapBOToModel(bo);

            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.Id.Should().Be(1);
            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");
        }
Ejemplo n.º 4
0
        public void MapEFToBO()
        {
            var    mapper = new DALLessonMapper();
            Lesson entity = new Lesson();

            entity.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), 1m, 1, 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.MapEFToBO(entity);

            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.Id.Should().Be(1);
            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");
        }