public void Setup() { messageWriter = new Mock<IMessageWriter>(); logger = new Mock<ILogger>(); var drinkFactory = new DrinkFactory(); var drinkPreperationFactory = new DrinkPreperationFactory(); var newCafe = new NewAcuCafe(logger.Object, messageWriter.Object, drinkFactory,drinkPreperationFactory); newCafe.OrderDrink("", true, false); }
public static Drink OrderDrink(string type, bool hasMilk, bool hasSugar) { var logger = new FileLogger(); var messageWriter = new ConsoleWriter(); var drinkFactory = new DrinkFactory(); var drinkPreperationFactory = new DrinkPreperationFactory(); //should not break any dependancies the clients could be having on this class return new NewAcuCafe(logger, messageWriter, drinkFactory, drinkPreperationFactory).OrderDrink(type, hasMilk, hasSugar); }
public void WriteMessageIsCalledWithErrorMessage() { var messageWriter = new Mock<IMessageWriter>(); var logger = new Mock<ILogger>(); var drinkFactory = new DrinkFactory(); var drinkPreperationFactory = new DrinkPreperationFactory(); var newCafe = new NewAcuCafe(logger.Object, messageWriter.Object, drinkFactory, drinkPreperationFactory); newCafe.OrderDrink("IceTea", true, false); messageWriter.Verify(m => m.WriteMesage("Cannot make ice tea with milk")); }
public void WriteMessageIsCalled(string type) { var messageWriter = new Mock<IMessageWriter>(); var logger = new Mock<ILogger>(); var drinkFactory = new DrinkFactory(); var drinkPreperationFactory = new DrinkPreperationFactory(); var newCafe = new NewAcuCafe(logger.Object, messageWriter.Object,drinkFactory,drinkPreperationFactory); newCafe.OrderDrink(type, true, false); messageWriter.Verify(m => m.WriteMesage(It.IsAny<string>())); }