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

            item.SetProperties(1, "A", "A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1);
            List <ApiSaleServerResponseModel> response = mapper.MapEntityToModel(new List <Sale>()
            {
                { item }
            });

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

            model.SetProperties("A", "A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1);
            Sale response = mapper.MapModelToEntity(1, model);

            response.IpAddress.Should().Be("A");
            response.Notes.Should().Be("A");
            response.SaleDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.TransactionId.Should().Be(1);
        }
Example #3
0
        public void MapEntityToModel()
        {
            var  mapper = new DALSaleMapper();
            Sale item   = new Sale();

            item.SetProperties(1, "A", "A", DateTime.Parse("1/1/1987 12:00:00 AM"), 1);
            ApiSaleServerResponseModel response = mapper.MapEntityToModel(item);

            response.Id.Should().Be(1);
            response.IpAddress.Should().Be("A");
            response.Notes.Should().Be("A");
            response.SaleDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.TransactionId.Should().Be(1);
        }