public void CreateBuyNGetMAtXPercentOffSpecial_CreatesSpecial() { var args = new CreateBuyNGetMAtXPercentOffSpecialArgs { DiscountedItems = 1, EndTime = _now.EndOfWeek(), Limit = 6, PercentageOff = 50m, PreDiscountItems = 2, ProductName = "can of soup", StartTime = _now.StartOfWeek() }; var productDto = _productSpecialConfigurationService.CreateBuyNGetMAtXPercentOffSpecial(args); var specialDto = (BuyNGetMAtXPercentOffSpecialDto)productDto.Special; productDto.Name.Should().Be(args.ProductName); specialDto.DiscountedItems.Should().Be(args.DiscountedItems); specialDto.EndTime.Should().Be(args.EndTime.Value); specialDto.Limit.Should().Be(args.Limit); specialDto.PercentageOff.Should().Be(args.PercentageOff); specialDto.PreDiscountItems.Should().Be(args.PreDiscountItems); specialDto.StartTime.Should().Be(args.StartTime.Value); }
public ActionResult <ProductDto> CreateBuyNGetMAtXPercentOffSpecial(string productName, [FromBody] CreateBuyNGetMAtXPercentOffSpecialArgs args) { args.ProductName = productName; return(_productSpecialConfigurationService.CreateBuyNGetMAtXPercentOffSpecial(args)); }