static void Main() { // Expresso without condiments Beverage beverage = new Expresso(); Console.WriteLine($"{beverage.GetDescription()} ${beverage.Cost()}"); // DarkRoast Beverage beverage2 = new DarkRoast(); beverage2 = new Mocha(beverage2); beverage2 = new Mocha(beverage2); beverage2 = new Whip(beverage2); Console.WriteLine($"{beverage2.GetDescription()} ${beverage2.Cost()}"); // HouseBlend Beverage beverage3 = new HouseBlend(); beverage3 = new Soy(beverage3); beverage3 = new Mocha(beverage3); beverage3 = new Whip(beverage3); Console.WriteLine($"{beverage3.GetDescription()} ${beverage3.Cost()}"); Console.ReadKey(); }
public void TestExpresso() { Beverage beverage = new Expresso(); Assert.AreEqual("Expresso $1.5", beverage.GetDescription() + " $" + beverage.Cost()); }
static void Main(string[] args) { Beverage beverage = new Expresso(); Console.WriteLine(beverage.GetDescription() + " R$" + beverage.Cost()); Console.WriteLine(); Beverage beverage2 = new DarkRoast(); beverage2 = new Mocha(beverage2); beverage2 = new Mocha(beverage2); beverage2 = new Whip(beverage2); Console.WriteLine(beverage2.GetDescription() + " R$" + beverage2.Cost()); Console.WriteLine(); Beverage beverage3 = new HouseBlend(); beverage3 = new Soy(beverage3); beverage3 = new Mocha(beverage3); beverage3 = new Whip(beverage3); Console.WriteLine(beverage3.GetDescription() + " R$" + beverage3.Cost()); Console.WriteLine(); Console.ReadKey(); }
public void GetDescriptionShouldReturnDescriptionWithTextSettedInConstructor() { var expectedValue = "Expresso"; var expresso = new Expresso(); expresso.GetDescription().Should() .Be(expectedValue); }
public void BeverageShouldHaveDescription() { var expected = "This is an Expresso"; Expresso expresso = new Expresso(); var result = expresso.GetDescription(); result.Should().Be(expected); }
public static void Run() { Drink drink = new Expresso(); System.Console.WriteLine($"{drink.GetDescription()}: {drink.Price()} zł"); drink = new Chocolate(drink); drink = new Chocolate(drink); drink = new WhippedCream(drink); System.Console.WriteLine($"{drink.GetDescription()}: {drink.Price()} zł"); }
static void Main(string[] args) { Beverage beverage = new Expresso(Size.Grande); Console.WriteLine(beverage.GetDescription() + " | " + beverage.Cost()); Beverage beverage2 = new Expresso(Size.Grande); beverage2 = new Mocha(beverage2); beverage2 = new Whip(beverage2); Console.WriteLine(beverage2.GetDescription() + " | " + beverage2.Cost()); }
public void Expresso_ShouldBeExpressoAndCostOneDollarAndFiftyCents_WhenIsInstantiate() { //Arrange Beverage beverage = new Expresso(); //Act var description = beverage.GetDescription(); var cost = beverage.Cost(); //Assert description.Should().Be("Expresso"); cost.Should().Be(1.5); beverage.Size.Should().Be(BeverageSize.TALL); }
static void RunDecorator() { Beverage beverage = new Expresso(); Console.WriteLine(beverage.GetDescription() + " $ " + beverage.Cost()); Beverage beverage2 = new HouseBlend(); beverage2 = new Mocha(beverage2); beverage2 = new Soy(beverage2); beverage2 = new Whip(beverage2); Console.WriteLine(beverage2.GetDescription() + " $ " + beverage2.Cost()); }
public void ExpressoGrande_ShouldBeExpressoAndCostOneDollarAndSeventyFiveCents_WhenIsInstantiate() { //Arrange BeverageSize beverageSize = BeverageSize.GRANDE; Beverage beverage = new Expresso(); beverage.Size = beverageSize; //Act var description = beverage.GetDescription(); var cost = beverage.Cost(); //Assert description.Should().Be("Expresso"); cost.Should().Be(1.75); beverage.Size.Should().Be(beverageSize); }
public void ExpressoVenti_ShouldBeExpressoAndCostThreeDollars_WhenIsInstantiate() { //Arrange BeverageSize beverageSize = BeverageSize.VENTI; Beverage beverage = new Expresso(); beverage.Size = beverageSize; //Act var description = beverage.GetDescription(); var cost = beverage.Cost(); //Assert description.Should().Be("Expresso"); cost.Should().Be(3); beverage.Size.Should().Be(beverageSize); }