public void When_ingredient_2_is_fatal() { //Arrange var mockIngredientRepo = A.Fake <IIngredientRepository>(); A.CallTo(() => mockIngredientRepo.GetAllMixes()).Returns( new List <IngredientMix>() { new IngredientMix { Ingredient2 = (int)MockIngredients.A, IsFatal = true } }); var mixer = new IngredientMixingManager(mockIngredientRepo); //Act var mixResult = mixer.Mix(0, (int)MockIngredients.A, 0); //Assert Assert.IsNotNull(mixResult); Assert.IsTrue(mixResult.IsMixFatal); Assert.IsTrue(mixResult.IsMixDocumented); }
public void When_both_ingredients_are_found_in_a_mix_with_a_mood() { //Arrange var mockIngredientRepo = A.Fake <IIngredientRepository>(); A.CallTo(() => mockIngredientRepo.GetAllMixes()).Returns( new List <IngredientMix>() { new IngredientMix { Ingredient1 = (int)MockIngredients.A, Ingredient2 = (int)MockIngredients.B, MoodType = (int)MockMoods.Postive, Effect = MockMoods.Postive.ToString(), IsFatal = false }, new IngredientMix { Ingredient1 = (int)MockIngredients.A, Ingredient2 = (int)MockIngredients.B, MoodType = (int)MockMoods.Negative, Effect = MockMoods.Negative.ToString(), IsFatal = false } }); var mixer = new IngredientMixingManager(mockIngredientRepo); //Act var mixResult = mixer.Mix((int)MockMoods.Postive, (int)MockIngredients.A, (int)MockIngredients.B); //Assert Assert.IsNotNull(mixResult); Assert.IsFalse(mixResult.IsMixFatal); Assert.IsTrue(mixResult.IsMixDocumented); Assert.AreEqual(mixResult.Effect, MockMoods.Postive.ToString()); }