Esempio n. 1
0
        public void TestGetAvailableGamesNonEmptyList()
        {
            ProductDistributor producer    = new ProductDistributor();
            Product            testProduct = ProductFlyweightFactory.MakeProduct();

            producer.AddProduct(testProduct);

            Assert.IsNotEmpty(producer.GetAvailableGames());
        }
Esempio n. 2
0
        public void TestAddGame()
        {
            ProductDistributor producer    = new ProductDistributor();
            Product            testProduct = ProductFlyweightFactory.MakeProduct();

            producer.AddProduct(testProduct);
            int testAvailableGames = producer.GetAvailableGames().Count;

            Assert.AreEqual(1, testAvailableGames);
        }
Esempio n. 3
0
        public void TestAddAndRemoveMoreGames()
        {
            ProductDistributor producer     = new ProductDistributor();
            Product            testProduct  = ProductFlyweightFactory.MakeProduct();
            Product            testProduct2 = ProductFlyweightFactory.MakeProduct();
            Product            testProduct3 = ProductFlyweightFactory.MakeProduct();

            producer.AddProduct(testProduct);
            producer.AddProduct(testProduct2);
            producer.AddProduct(testProduct3);

            producer.RemoveProduct(testProduct2);

            int testAvailableGames = producer.GetAvailableGames().Count;

            Assert.AreEqual(2, testAvailableGames);
        }
Esempio n. 4
0
        public void TestGetAvailbleGamesEmtyList()
        {
            ProductDistributor producer = new ProductDistributor();

            Assert.IsEmpty(producer.GetAvailableGames());
        }