Ejemplo n.º 1
0
        public void MapModelToEntity()
        {
            var mapper = new DALTimestampCheckMapper();
            ApiTimestampCheckServerRequestModel model = new ApiTimestampCheckServerRequestModel();

            model.SetProperties("A", BitConverter.GetBytes(1));
            TimestampCheck response = mapper.MapModelToEntity(1, model);

            response.Name.Should().Be("A");
            response.Timestamp.Should().BeEquivalentTo(BitConverter.GetBytes(1));
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 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);
        }