Beispiel #1
0
        public void TestAddMoreGames()
        {
            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);

            int testAvailableGames = producer.GetAvailableGames().Count;

            Assert.AreEqual(3, testAvailableGames);
        }
Beispiel #2
0
        public void TestGetProductGamesFound()
        {
            ProductDistributor producer    = new ProductDistributor();
            Product            testProduct = ProductFlyweightFactory.MakeProduct();

            producer.AddProduct(testProduct);

            Assert.IsNotNull(producer.GetProduct(testProduct.Game.GetName()));
        }
Beispiel #3
0
        public void TestProductAvailable()
        {
            ProductDistributor producer    = new ProductDistributor();
            Product            testProduct = ProductFlyweightFactory.MakeProduct();

            producer.AddProduct(testProduct);

            Assert.IsTrue(producer.ProductAvailable(testProduct.Game.GetName()));
        }
Beispiel #4
0
        public void TestProductNotAvailableWithElements()
        {
            ProductDistributor producer    = new ProductDistributor();
            Product            testProduct = ProductFlyweightFactory.MakeProduct();

            producer.AddProduct(testProduct);

            Assert.IsFalse(producer.ProductAvailable("TestGame"));
        }
Beispiel #5
0
        public void TestGetAvailableGamesNonEmptyList()
        {
            ProductDistributor producer    = new ProductDistributor();
            Product            testProduct = ProductFlyweightFactory.MakeProduct();

            producer.AddProduct(testProduct);

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