Exemple #1
0
        public void MapBOToModelList()
        {
            var      mapper = new BOLTagSetMapper();
            BOTagSet bo     = new BOTagSet();

            bo.SetProperties("A", BitConverter.GetBytes(1), "A", "A", 1);
            List <ApiTagSetResponseModel> response = mapper.MapBOToModel(new List <BOTagSet>()
            {
                { bo }
            });

            response.Count.Should().Be(1);
        }
Exemple #2
0
        public void MapModelToBO()
        {
            var mapper = new BOLTagSetMapper();
            ApiTagSetRequestModel model = new ApiTagSetRequestModel();

            model.SetProperties(BitConverter.GetBytes(1), "A", "A", 1);
            BOTagSet response = mapper.MapModelToBO("A", model);

            response.DataVersion.Should().BeEquivalentTo(BitConverter.GetBytes(1));
            response.JSON.Should().Be("A");
            response.Name.Should().Be("A");
            response.SortOrder.Should().Be(1);
        }
Exemple #3
0
        public void MapBOToModel()
        {
            var      mapper = new BOLTagSetMapper();
            BOTagSet bo     = new BOTagSet();

            bo.SetProperties("A", BitConverter.GetBytes(1), "A", "A", 1);
            ApiTagSetResponseModel response = mapper.MapBOToModel(bo);

            response.DataVersion.Should().BeEquivalentTo(BitConverter.GetBytes(1));
            response.Id.Should().Be("A");
            response.JSON.Should().Be("A");
            response.Name.Should().Be("A");
            response.SortOrder.Should().Be(1);
        }
Exemple #4
0
        public void MapEFToBO()
        {
            var    mapper = new DALTagSetMapper();
            TagSet entity = new TagSet();

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

            BOTagSet response = mapper.MapEFToBO(entity);

            response.DataVersion.Should().BeEquivalentTo(BitConverter.GetBytes(1));
            response.Id.Should().Be("A");
            response.JSON.Should().Be("A");
            response.Name.Should().Be("A");
            response.SortOrder.Should().Be(1);
        }