Esempio n. 1
0
        public void CampaignService_Should_AddNewCampaign()
        {
            var product = productService.GetProduct("p1");

            campaignService.AddCampaing("c1", product, 10, 20, 100);

            var campaign = campaignService.GetCampaignInfo("c1");

            campaign.Count.Value.Should().Be(100);

            campaign.Limit.Value.Should().Be(20);

            campaign.Duration.Value.Should().Be(10);

            campaign.Name.Value.Should().Be("c1");

            campaign.Product.ProductCode.Value.Should().Be("p1");
        }
        public void CreateCampaignCommand(string[] arguments)
        {
            string campaignName           = GetParameter <string>(arguments, 0);
            string productCode            = GetParameter <string>(arguments, 1);
            int    duration               = GetParameter <int>(arguments, 2);
            int    priceManipulationLimit = GetParameter <int>(arguments, 3);
            int    targetSalesCount       = GetParameter <int>(arguments, 4);

            var product = productService.GetProduct(productCode);

            campaignService.AddCampaing(campaignName, product, duration, priceManipulationLimit, targetSalesCount);
        }