Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. [Test]
  2. public void AddMoreThanOneReciepeItems()
  3. {
  4. var inventory = new HeroInventory();
  5. var itemA = new RecipeItem("A", 5, 5, 5, 5, 5, new List<string>());
  6. var itemB = new RecipeItem("B", 5, 5, 5, 5, 5, new List<string>());
  7.  
  8. inventory.AddRecipeItem(itemA);
  9. inventory.AddRecipeItem(itemB);
  10.  
  11. var typeInventory = inventory.GetType()
  12. .GetField("recipeItems", BindingFlags.Instance | BindingFlags.NonPublic);
  13. var fildDict = (Dictionary<string, IRecipe>)typeInventory.GetValue(inventory);
  14. var count = fildDict.Count;
  15. Assert.AreEqual(2, count);
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement