Esempio n. 1
0
        public void MapModelToEntity()
        {
            var mapper = new DALBucketMapper();
            ApiBucketServerRequestModel model = new ApiBucketServerRequestModel();

            model.SetProperties(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), "A");
            Bucket response = mapper.MapModelToEntity(1, model);

            response.ExternalId.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.Name.Should().Be("A");
        }
Esempio n. 2
0
        public void MapEntityToModel()
        {
            var    mapper = new DALBucketMapper();
            Bucket item   = new Bucket();

            item.SetProperties(1, Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), "A");
            ApiBucketServerResponseModel response = mapper.MapEntityToModel(item);

            response.ExternalId.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.Id.Should().Be(1);
            response.Name.Should().Be("A");
        }
Esempio n. 3
0
        public void MapEntityToModelList()
        {
            var    mapper = new DALBucketMapper();
            Bucket item   = new Bucket();

            item.SetProperties(1, Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), "A");
            List <ApiBucketServerResponseModel> response = mapper.MapEntityToModel(new List <Bucket>()
            {
                { item }
            });

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