Package personal.mhc.pardus.model.commodities

Examples of personal.mhc.pardus.model.commodities.VIP


     * Test updatePriceGuide(...) works with a priceGuide.
     */
    @Test
    public void testUpdatePriceGuide(){
        // Create CommodityImpl to update.
        CommodityImpl commodity = new VIP();
        // Set commodity's amount.
        commodity.setAmount(10);
        // Create a priceGuide.
        PriceGuide priceGuide = pgs.newPriceGuide();
        // Call updatePriceGuide with a PriceGuide.
        PriceGuide pg = null;
        try {
            pg = pgs.updatePriceGuide(priceGuide, commodity);
        } catch (CommodityException ex) {
            fail();
        }
        // Did it update the commodity?
        assertTrue(pg.getVIP().getAmount() == commodity.getAmount());
        // Did it leave other commodities alone?
        assertTrue(pg.getFood().getAmount() == 0);
    }
View Full Code Here


     * Test updatePriceGuide(...) works even though there is no priceGuide provided.
     */
    @Test
    public void testUpdatePriceGuideNoPriceGuideProvided(){
        // Create CommodityImpl to update.
        CommodityImpl commodity = new VIP();
        // Set commodity's amount.
        commodity.setAmount(10);
        // Call updatePriceGuide without having a PriceGuide.
        PriceGuide pg = null;
        try {
            pg = pgs.updatePriceGuide(null, commodity);
        } catch (CommodityException ex) {
            fail();
        }
        // Did it update the commodity?
        assertTrue(pg.getVIP().getAmount() == commodity.getAmount());
        // Did it leave other commodities alone?
        assertTrue(pg.getFood().getAmount() == 0);
    }
View Full Code Here

                case 37: comm = new KeldonBrains();break;
                case 38: comm = new RashkirBones(); break;
                case 39: comm = new Packages(); break;
                case 40: comm = new FactionPackage(); break;
                case 41: comm = new Explosives();break;
                case 42: comm = new VIP(); break;
                case 43: comm = new NeuralStimulator();break;
                case 44: comm = new X993RepairDrone();break;
                default: comm = new Food();break;
            }
            // And get the amount and max.
View Full Code Here

TOP

Related Classes of personal.mhc.pardus.model.commodities.VIP

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.