示例#1
0
        public IEnumerator TestFlowerGeneration()
        {
            SceneManager.LoadScene("MainScene");
            yield return(null);

            BeehiveManager bm = Object.FindObjectOfType <BeehiveManager>();

            Assert.IsNotNull(bm);
            MapGenerator mg = bm.GetComponent <MapGenerator>();

            Assert.IsNotNull(mg);
            bm.EnterMapView();
            int flowers_real = mg.renderTexture.GetComponentsInChildren <Flower>().Count();

            Assert.AreEqual(mg.numFlowers, flowers_real);
        }
示例#2
0
        public IEnumerator TestFlowerRandomisationGeneration()
        {
            SceneManager.LoadScene("MainScene");
            yield return(null);

            BeehiveManager bm = Object.FindObjectOfType <BeehiveManager>();

            Assert.IsNotNull(bm);
            MapGenerator mg = bm.GetComponent <MapGenerator>();

            Assert.IsNotNull(mg);
            bm.EnterMapView();

            foreach (Flower f in mg.renderTexture.GetComponentsInChildren <Flower>())
            {
                Assert.IsNotNull(f.description);
                Assert.IsNotNull(f.successChance);
                Assert.IsNotNull(f.reward);
                Assert.IsNotNull(f.beesRequired);
                Assert.IsNotNull(f.GetComponent <SpriteRenderer>());
            }
        }