Esempio n. 1
0
        public void MapRequestToResponse()
        {
            var mapper = new ApiProductModelMapper();
            var model  = new ApiProductRequestModel();

            model.SetProperties("A", "A", 1, DateTime.Parse("1/1/1987 12:00:00 AM"), true, 1m, true, DateTime.Parse("1/1/1987 12:00:00 AM"), "A", "A", 1, "A", 1, 1, Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), 1, DateTime.Parse("1/1/1987 12:00:00 AM"), DateTime.Parse("1/1/1987 12:00:00 AM"), "A", "A", 1m, "A", 1, "A");
            ApiProductResponseModel response = mapper.MapRequestToResponse(1, model);

            [email protected]().Be("A");
            response.Color.Should().Be("A");
            response.DaysToManufacture.Should().Be(1);
            response.DiscontinuedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.FinishedGoodsFlag.Should().Be(true);
            response.ListPrice.Should().Be(1m);
            response.MakeFlag.Should().Be(true);
            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
            response.ProductID.Should().Be(1);
            response.ProductLine.Should().Be("A");
            response.ProductModelID.Should().Be(1);
            response.ProductNumber.Should().Be("A");
            response.ProductSubcategoryID.Should().Be(1);
            response.ReorderPoint.Should().Be(1);
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.SafetyStockLevel.Should().Be(1);
            response.SellEndDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.SellStartDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Size.Should().Be("A");
            response.SizeUnitMeasureCode.Should().Be("A");
            response.StandardCost.Should().Be(1m);
            response.Style.Should().Be("A");
            response.Weight.Should().Be(1);
            response.WeightUnitMeasureCode.Should().Be("A");
        }
Esempio n. 2
0
        private async Task <ApiProductResponseModel> CreateRecord(ApiClient client)
        {
            var model = new ApiProductRequestModel();

            model.SetProperties("B", "B", 2, DateTime.Parse("1/1/1988 12:00:00 AM"), true, 2m, true, DateTime.Parse("1/1/1988 12:00:00 AM"), "B", "B", 2, "B", 2, 2, Guid.Parse("3842cac4-b9a0-8223-0dcc-509a6f75849b"), 2, DateTime.Parse("1/1/1988 12:00:00 AM"), DateTime.Parse("1/1/1988 12:00:00 AM"), "B", "B", 2m, "B", 2, "B");
            CreateResponse <ApiProductResponseModel> result = await client.ProductCreateAsync(model);

            result.Success.Should().BeTrue();
            return(result.Record);
        }