public void DinoEra_CreateInstance_DinoEraObject() { DinoEra era = new DinoEra(); Assert.IsInstanceOfType(era, typeof(DinoEra)); CollectionAssert.AreEqual(new Dictionary <string, List <string> > { }, era.EraItems); }
public ActionResult PackCheck(string eraName) { DinoEra eras = new DinoEra(); Console.WriteLine(eraName); Dictionary <string, DinoEra> groupModel = new Dictionary <string, DinoEra> { }; groupModel.Add(eraName, eras); return(View(groupModel)); }
public bool CheckPack(DinoEra era, string eraName) { bool isPackReady = true; List <string> requiredItems = era.EraItems[eraName]; foreach (string item in requiredItems) { if (!Items.Contains(item)) { isPackReady = false; break; } } return(isPackReady); }
public void AddEra_AddEraAndItemsToDictionary_UpdateDictionary() { DinoEra era = new DinoEra(); List <string> itemsForEra = new List <string> { "shovel", "food", "water", "clothes", "dino-deterrent" }; era.EraItems.Add("Jurassic", itemsForEra); Dictionary <string, List <string> > result = new Dictionary <string, List <string> > { }; result.Add("Jurassic", itemsForEra); CollectionAssert.AreEqual(result, era.EraItems); }
public void CheckPack_CheckIfPackContainsAllNeededItems_False() { Pack pack = new Pack(); pack.Items.AddRange(new List <string> { "shovel", "water" }); DinoEra era = new DinoEra(); List <string> itemsForEra = new List <string> { "shovel", "food", "water", "clothes", "dino-deterrent" }; era.EraItems.Add("Jurassic", itemsForEra); bool packIsReady = pack.CheckPack(era, "Jurassic"); Assert.AreEqual(false, packIsReady); }