public void CafeConHielo() { BeverageComponent b = new Coffee(); b = new IceDecorator(b); Assert.True(b.getCost() == 2.0); Assert.True(b.getDescription() == "Café, con hielo"); }
public void CafeConHieloGrande() { BeverageComponent b = new Coffee(); b = new IceDecorator(b); b = new GrandSizeDecorator(b); Assert.True(b.getCost() == 3.75); Assert.True(b.getDescription() == "Café, con hielo, tamaño grande"); }
public void Setup() { //Create the spell ISpell someSpell = new Spell(5); //Decorate it with fire damage FireDecorator fireDecorator = new FireDecorator(20); someSpell = fireDecorator.Decorate(someSpell); //Decorate some more with ice damage IceDecorator iceDecorator = new IceDecorator(10); someSpell = iceDecorator.Decorate(someSpell); //Cast the decorated spell (dealing 35 damage with effects: Normal, Fire and Ice) someSpell.Cast(); }