public void GivenIHaveAStarter_WhenIPrepareIt_IShouldBeAbleToPrepareWithASpecificOptionNormalSalt() { //arrange _fakePrepareOption.OptionStarterType = OptionDishesTypes.NormalSalt; var prepareStarter = new BasePrepareDish(_fakePrepareOption, _starter); //act var preparedDish = prepareStarter.Prepare(); //assert Assert.IsTrue(_fakePrepareOption.PrepareWithSpecificOptionsIsCalled); Assert.AreEqual(OptionDishesTypes.NormalSalt, preparedDish.OptionPrepared); }
public void GivenIHaveAMainCourse_WhenIPrepareIt_IShouldBeAbleToPrepareWithSpecifciOptionSpicy() { //arrange _mockOptionPrepare.Setup(_ => _.OptionDescription).Returns(Utility.GetEnumDescription(OptionDishesTypes.PreparedSpicy)); _mockOptionPrepare.Setup(_ => _.PrepareWithSpecificOptions()).Returns(OptionDishesTypes.PreparedSpicy); var prepareMainCourse = new BasePrepareDish(_mockOptionPrepare.Object, _mainCourse); //act var preparedDish = prepareMainCourse.Prepare(); //assert _mockOptionPrepare.Verify(_ => _.PrepareWithSpecificOptions(), Times.Once()); Assert.AreEqual(OptionDishesTypes.PreparedSpicy, preparedDish.OptionPrepared); }
public void GivenIHaveADessert_WhenIPrepareIt_IShouldBeAbleToPrepareWithoutSugar() { //assert _mockOptionPrepare.Setup(_ => _.OptionDescription).Returns(Utility.GetEnumDescription(OptionDishesTypes.WithoutSugar)); _mockOptionPrepare.Setup(_ => _.PrepareWithSpecificOptions()).Returns(OptionDishesTypes.WithoutSugar); var prepareDish = new BasePrepareDish(_mockOptionPrepare.Object, _dessert); //act var result = prepareDish.Prepare(); //arrange _mockOptionPrepare.Verify(_ => _.PrepareWithSpecificOptions(), Times.AtLeastOnce); Assert.AreEqual(OptionDishesTypes.WithoutSugar, result.OptionPrepared); }