示例#1
0
    public void check_do_sale_for_just_sale(String campaign, String product, String order)
    {
        PoolManager poolManager = new PoolManager();

        String[] sCamp        = campaign.Split(" ");
        String[] sPro         = product.Split(" ");
        String[] sOrd         = order.Split(" ");
        Campaign campaignTemp = new Campaign(sCamp[1], sCamp[2],
                                             Double.Parse(sCamp[3]), Double.Parse(sCamp[4]), Double.Parse(sCamp[5]));
        Product productTemp = new Product(sPro[1], Double.Parse(sPro[2]), Double.Parse(sPro[3]), false);

        poolManager.getProducts().Add(productTemp);
        poolManager.getCampaigns().Add(campaignTemp);
        campaignController.doSale(sOrd, productTemp, poolManager);
        Assert.Equal(Int32.Parse(sOrd[2]), (int)(poolManager.getCampaigns()[0])._totalSales);
    }