コード例 #1
0
        public virtual TimestampCheck MapBOToEF(
            BOTimestampCheck bo)
        {
            TimestampCheck efTimestampCheck = new TimestampCheck();

            efTimestampCheck.SetProperties(
                bo.Id,
                bo.Name,
                bo.Timestamp);
            return(efTimestampCheck);
        }
コード例 #2
0
        public void MapEntityToModel()
        {
            var            mapper = new DALTimestampCheckMapper();
            TimestampCheck item   = new TimestampCheck();

            item.SetProperties(1, "A", BitConverter.GetBytes(1));
            ApiTimestampCheckServerResponseModel response = mapper.MapEntityToModel(item);

            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
            response.Timestamp.Should().BeEquivalentTo(BitConverter.GetBytes(1));
        }
コード例 #3
0
        public void MapEntityToModelList()
        {
            var            mapper = new DALTimestampCheckMapper();
            TimestampCheck item   = new TimestampCheck();

            item.SetProperties(1, "A", BitConverter.GetBytes(1));
            List <ApiTimestampCheckServerResponseModel> response = mapper.MapEntityToModel(new List <TimestampCheck>()
            {
                { item }
            });

            response.Count.Should().Be(1);
        }
コード例 #4
0
        public void MapEFToBO()
        {
            var            mapper = new DALTimestampCheckMapper();
            TimestampCheck entity = new TimestampCheck();

            entity.SetProperties(1, "A", BitConverter.GetBytes(1));

            BOTimestampCheck response = mapper.MapEFToBO(entity);

            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
            response.Timestamp.Should().BeEquivalentTo(BitConverter.GetBytes(1));
        }
コード例 #5
0
        public virtual TimestampCheck MapModelToEntity(
            int id,
            ApiTimestampCheckServerRequestModel model
            )
        {
            TimestampCheck item = new TimestampCheck();

            item.SetProperties(
                id,
                model.Name,
                model.Timestamp);
            return(item);
        }
コード例 #6
0
        public void MapEFToBOList()
        {
            var            mapper = new DALTimestampCheckMapper();
            TimestampCheck entity = new TimestampCheck();

            entity.SetProperties(1, "A", BitConverter.GetBytes(1));

            List <BOTimestampCheck> response = mapper.MapEFToBO(new List <TimestampCheck>()
            {
                entity
            });

            response.Count.Should().Be(1);
        }