public void DinoEra_CreateInstance_DinoEraObject()
        {
            DinoEra era = new DinoEra();

            Assert.IsInstanceOfType(era, typeof(DinoEra));
            CollectionAssert.AreEqual(new Dictionary <string, List <string> > {
            }, era.EraItems);
        }
Example #2
0
        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));
        }
Example #3
0
        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);
        }
Example #5
0
        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);
        }