示例#1
0
        public void TestAddRecipe()
        {
            Company testCompany = new Company("testco", 1000);
            Recipe testRecipe = new Recipe();

            // Starts at 0
            Assert.AreEqual(0, testCompany.recipes.Count);

            // Add 1
            Assert.IsTrue(testCompany.Add(testRecipe));
            Assert.AreEqual(1, testCompany.recipes.Count);

            // Add another
            Assert.IsTrue(testCompany.Add(testRecipe));
            Assert.AreEqual(2, testCompany.recipes.Count);
        }
示例#2
0
        public void TestAddBrewery()
        {
            Company testCompany = new Company("testco", 1000);
            Brewery testBrewery = new Brewery();
            Location testLocation1 = new Location("testloc1", new int[] {1,1});
            Location testLocation2 = new Location("testloc2", new int[] {2,2});

            // Successfully add a brewery
            Assert.IsTrue(testCompany.Add(testBrewery, testLocation1));

            // Can't add to the same location
            Assert.IsFalse(testCompany.Add(testBrewery, testLocation1));

            // Still only 1
            Assert.AreEqual(1, testCompany.breweries.Count);

            // Can add to a new location
            Assert.IsTrue(testCompany.Add(testBrewery, testLocation2));
        }