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); }
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 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"); }
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"); }