Esempio n. 1
0
        public void MapBOToModelList()
        {
            var     mapper = new BOLShiftMapper();
            BOShift bo     = new BOShift();

            bo.SetProperties(1, TimeSpan.Parse("0"), DateTime.Parse("1/1/1987 12:00:00 AM"), "A", TimeSpan.Parse("0"));
            List <ApiShiftResponseModel> response = mapper.MapBOToModel(new List <BOShift>()
            {
                { bo }
            });

            response.Count.Should().Be(1);
        }
Esempio n. 2
0
        public void MapModelToBO()
        {
            var mapper = new BOLShiftMapper();
            ApiShiftRequestModel model = new ApiShiftRequestModel();

            model.SetProperties(TimeSpan.Parse("0"), DateTime.Parse("1/1/1987 12:00:00 AM"), "A", TimeSpan.Parse("0"));
            BOShift response = mapper.MapModelToBO(1, model);

            response.EndTime.Should().Be(TimeSpan.Parse("0"));
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
            response.StartTime.Should().Be(TimeSpan.Parse("0"));
        }
Esempio n. 3
0
        public void MapBOToModel()
        {
            var     mapper = new BOLShiftMapper();
            BOShift bo     = new BOShift();

            bo.SetProperties(1, TimeSpan.Parse("0"), DateTime.Parse("1/1/1987 12:00:00 AM"), "A", TimeSpan.Parse("0"));
            ApiShiftResponseModel response = mapper.MapBOToModel(bo);

            response.EndTime.Should().Be(TimeSpan.Parse("0"));
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
            response.ShiftID.Should().Be(1);
            response.StartTime.Should().Be(TimeSpan.Parse("0"));
        }
Esempio n. 4
0
        public void MapEFToBO()
        {
            var   mapper = new DALShiftMapper();
            Shift entity = new Shift();

            entity.SetProperties(TimeSpan.Parse("0"), DateTime.Parse("1/1/1987 12:00:00 AM"), "A", 1, TimeSpan.Parse("0"));

            BOShift response = mapper.MapEFToBO(entity);

            response.EndTime.Should().Be(TimeSpan.Parse("0"));
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
            response.ShiftID.Should().Be(1);
            response.StartTime.Should().Be(TimeSpan.Parse("0"));
        }