示例#1
0
        public void MapEntityToModelList()
        {
            var  mapper = new DALSaleMapper();
            Sale item   = new Sale();

            item.SetProperties(1, 1m, "A", "A", 1, 1, "A");
            List <ApiSaleServerResponseModel> response = mapper.MapEntityToModel(new List <Sale>()
            {
                { item }
            });

            response.Count.Should().Be(1);
        }
示例#2
0
        public void MapModelToEntity()
        {
            var mapper = new DALSaleMapper();
            ApiSaleServerRequestModel model = new ApiSaleServerRequestModel();

            model.SetProperties(1m, "A", "A", 1, 1, "A");
            Sale response = mapper.MapModelToEntity(1, model);

            response.Amount.Should().Be(1m);
            response.FirstName.Should().Be("A");
            response.LastName.Should().Be("A");
            response.PaymentTypeId.Should().Be(1);
            response.PetId.Should().Be(1);
            response.Phone.Should().Be("A");
        }
示例#3
0
        public void MapEntityToModel()
        {
            var  mapper = new DALSaleMapper();
            Sale item   = new Sale();

            item.SetProperties(1, 1m, "A", "A", 1, 1, "A");
            ApiSaleServerResponseModel response = mapper.MapEntityToModel(item);

            response.Amount.Should().Be(1m);
            response.FirstName.Should().Be("A");
            response.Id.Should().Be(1);
            response.LastName.Should().Be("A");
            response.PaymentTypeId.Should().Be(1);
            response.PetId.Should().Be(1);
            response.Phone.Should().Be("A");
        }