Ejemplo n.º 1
0
        public void MapModelToBO()
        {
            var mapper = new BOLShipMethodMapper();
            ApiShipMethodRequestModel model = new ApiShipMethodRequestModel();

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

            response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
            response.Name.Should().Be("A");
            response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
            response.ShipBase.Should().Be(1m);
            response.ShipRate.Should().Be(1m);
        }
		public void CreatePatch()
		{
			var mapper = new ApiShipMethodModelMapper();
			var model = new ApiShipMethodRequestModel();
			model.SetProperties(DateTime.Parse("1/1/1987 12:00:00 AM"), "A", Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"), 1m, 1m);

			JsonPatchDocument<ApiShipMethodRequestModel> patch = mapper.CreatePatch(model);
			var response = new ApiShipMethodRequestModel();
			patch.ApplyTo(response);
			response.ModifiedDate.Should().Be(DateTime.Parse("1/1/1987 12:00:00 AM"));
			response.Name.Should().Be("A");
			response.Rowguid.Should().Be(Guid.Parse("8420cdcf-d595-ef65-66e7-dff9f98764da"));
			response.ShipBase.Should().Be(1m);
			response.ShipRate.Should().Be(1m);
		}