Exemplo n.º 1
0
        public void TestAdd()
        {
            Brewery testBrewery = new Brewery("Casey");
            Ingredient testIngredient = new Ingredient("test", 1);
            Brew testBrew = new Brew("american lager");
            FermVessel testFermVessel = new FermVessel();

            // Empty test
            Assert.AreEqual(0, testBrewery.ingBag.Count);
            Assert.AreEqual(0, testBrewery.brewBag.Count);
            Assert.AreEqual(0, testBrewery.fvBag.Count);

            // Add ingredient
            testBrewery.Add(testIngredient, 20);
            Assert.AreEqual(1, testBrewery.ingBag.Count);
            Assert.AreEqual(20, testBrewery.ingQty[0]);

            testBrewery.Add(new Ingredient("test", 1), 20);
            Assert.AreEqual(1, testBrewery.ingBag.Count);
            Assert.AreEqual(40, testBrewery.ingQty[0]);

            testBrewery.Add(new Ingredient("water", 1), 20);
            Assert.AreEqual(2, testBrewery.ingBag.Count);
            Assert.AreEqual(40, testBrewery.ingQty[0]);
            Assert.AreEqual(20, testBrewery.ingQty[1]);

            // Add brew
            testBrewery.Add(testBrew, 20);
            Assert.AreEqual(1, testBrewery.brewBag.Count);
            Assert.AreEqual(20, testBrewery.brewQty[0]);

            testBrewery.Add(new Brew("american lager"), 20);
            Assert.AreEqual(1, testBrewery.brewBag.Count);
            Assert.AreEqual(40, testBrewery.brewQty[0]);

            Brew brew2 = new Brew("test", 1);
            testBrewery.Add(brew2, 20);
            Assert.AreEqual(2, testBrewery.brewBag.Count);
            Assert.AreEqual(40, testBrewery.brewQty[0]);
            Assert.AreEqual(20, testBrewery.brewQty[1]);

            // Add fermentation vessel
            testBrewery.Add(testFermVessel);
            Assert.AreEqual(1, testBrewery.fvBag.Count);

            testBrewery.Add(new FermVessel());
            Assert.AreEqual(2, testBrewery.fvBag.Count);
        }
Exemplo n.º 2
0
 // Add FermVessel to Brewery
 public bool Add(FermVessel addFermVessel)
 {
     fvBag.Add(addFermVessel);
     return(true);
 }
Exemplo n.º 3
0
        public void TestEmpty()
        {
            Recipe testRecipe = new Recipe();
            FermVessel testFermVessel = new FermVessel();
            int starting = testRecipe.time;

            testFermVessel.Add(testRecipe.output,
                testRecipe.brewQty, testRecipe.time);

            testFermVessel.Empty();

            Assert.IsTrue(testFermVessel.isEmpty());
        }
Exemplo n.º 4
0
        public void TestAge()
        {
            Recipe testRecipe = new Recipe();
            FermVessel testFermVessel = new FermVessel();
            int starting = testRecipe.time;

            testFermVessel.Add(testRecipe.output,
                testRecipe.brewQty, testRecipe.time);

            testFermVessel.Age(1);

            Assert.AreEqual(starting - 1, testFermVessel.timeRemaining);
        }
Exemplo n.º 5
0
        public void TestAdd()
        {
            Recipe testRecipe = new Recipe();
            FermVessel testFermVessel = new FermVessel();

            // Able to add recipe successfully?
            bool success = testFermVessel.Add(testRecipe.output,
                testRecipe.brewQty, testRecipe.time);
            Assert.IsTrue(success);

            Assert.AreEqual(testRecipe.output,
                testFermVessel.storedBrew);
        }
Exemplo n.º 6
0
        public void TestRemoveFermVessel()
        {
            Brewery testBrewery = new Brewery("Casey");
            FermVessel testFermVessel = new FermVessel();

            testBrewery.Add(testFermVessel);
            Assert.AreEqual(1, testBrewery.fvBag.Count);

            testBrewery.RemoveFermVessel(0);
            Assert.AreEqual(0, testBrewery.fvBag.Count);
        }
Exemplo n.º 7
0
 // Add FermVessel to Brewery
 public bool Add(FermVessel addFermVessel)
 {
     fvBag.Add(addFermVessel);
     return true;
 }