Beispiel #1
0
        public void DeleteShopCtrFailId()
        {
            var shopCtr = new ShopCtr(new ShopCtrTestClass());
            var j       = shopCtr.DeleteShop(0);

            Assert.AreEqual(0, j);
        }
Beispiel #2
0
        public void GetShopCtrFailCvr2()
        {
            var shopCtr = new ShopCtr(new ShopCtrTestClass());
            var shop    = new Shop()
            {
                Name        = "hello world",
                Address     = "Hello address",
                OpeningTime = "Manday Never",
                Cvr         = "",
                Warehouses  = new List <Warehouse>(),
                Chain       = new Chain
                {
                    Id      = 1,
                    Cvr     = "12121212",
                    Name    = "",
                    Persons = new List <Person>(),
                    Shops   = new List <Shop>()
                }
            };
            var i = shopCtr.AddShop(shop);
            var j = shopCtr.GetShop(i);

            shopCtr.DeleteShop(i);
            Assert.IsNull(j);
        }
Beispiel #3
0
        public void GetShopCtrFailAll()
        {
            var shopCtr = new ShopCtr(new ShopCtrTestClass());
            var shop    = new Shop()
            {
                Name       = null,
                Address    = null,
                Cvr        = null,
                Warehouses = null
            };
            var i = shopCtr.AddShop(shop);
            var j = shopCtr.GetShop(i);

            shopCtr.DeleteShop(i);
            Assert.IsNull(j);
        }
Beispiel #4
0
        public void AddShopCtrFailWarehouse()
        {
            var shopCtr = new ShopCtr(new ShopCtrTestClass());
            var shop    = new Shop()
            {
                Name        = null,
                Address     = null,
                OpeningTime = "Manday Never",
                Cvr         = null,
                Warehouses  = null
            };
            var i = shopCtr.AddShop(shop);

            shopCtr.DeleteShop(i);
            Assert.AreEqual(0, i);
        }
Beispiel #5
0
        public void GetShopCtrFailWarehouse()
        {
            var shopCtr = new ShopCtr(new ShopCtrTestClass());
            var shop    = new Shop()
            {
                Name       = "hello world",
                Address    = "Hello address",
                Cvr        = "12121212",
                Warehouses = null,
                Chain      = null
            };
            var i = shopCtr.AddShop(shop);
            var j = shopCtr.GetShop(i);

            shopCtr.DeleteShop(i);
            Assert.IsNull(j);
        }
Beispiel #6
0
        public void DeleteShopCtr()
        {
            var shopCtr = new ShopCtr(new ShopCtrTestClass());
            var shop    = new Shop()
            {
                Name       = "hello world",
                Address    = "Hello address",
                Cvr        = "12121212",
                Warehouses = new List <Warehouse>(),
                Chain      = new Chain
                {
                    Id      = 1,
                    Cvr     = "12121212",
                    Name    = "",
                    Persons = new List <Person>(),
                    Shops   = new List <Shop>()
                }
            };
            var i = shopCtr.AddShop(shop);
            var j = shopCtr.DeleteShop(i);

            Assert.AreEqual(1, j);
        }
Beispiel #7
0
        public void AddShopCtrFailBoth2()
        {
            var shopCtr = new ShopCtr(new ShopCtrTestClass());
            var shop    = new Shop()
            {
                Name        = "",
                Address     = "",
                OpeningTime = "Manday Never",
                Cvr         = "",
                Warehouses  = new List <Warehouse>(),
                Chain       = new Chain
                {
                    Id      = 1,
                    Cvr     = "12121212",
                    Name    = "",
                    Persons = new List <Person>(),
                    Shops   = new List <Shop>()
                }
            };
            var i = shopCtr.AddShop(shop);

            shopCtr.DeleteShop(i);
            Assert.AreEqual(0, i);
        }
Beispiel #8
0
 public void DeleteShopTest([PexAssumeUnderTest] ShopCtr target, int id)
 {
     target.DeleteShop(id);
     // TODO: add assertions to method ShopCtrTest.DeleteShopTest(ShopCtr, Int32)
 }