コード例 #1
0
ファイル: ShopUnitTest.cs プロジェクト: MrBigBoy/BestilNemt
        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);
        }
コード例 #2
0
ファイル: ShopUnitTest.cs プロジェクト: MrBigBoy/BestilNemt
        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);
        }
コード例 #3
0
ファイル: ShopUnitTest.cs プロジェクト: MrBigBoy/BestilNemt
        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);
        }
コード例 #4
0
        public void AddShopTest()
        {
            Shop curShop = new Shop();

            curShop.Name    = "Netto";
            curShop.Address = "Nyvej";
            curShop.CVR     = "12121212";
            int i = 0;

            i = shopCtr.AddShop(curShop);


            // Shop shop = shopCtr.GetShop(curShop.Id);

            Assert.IsTrue(i == 1);
        }
コード例 #5
0
ファイル: ShopUnitTest.cs プロジェクト: MrBigBoy/BestilNemt
        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);
        }
コード例 #6
0
ファイル: ShopUnitTest.cs プロジェクト: MrBigBoy/BestilNemt
        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);
        }
コード例 #7
0
ファイル: ShopUnitTest.cs プロジェクト: MrBigBoy/BestilNemt
        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);
        }
コード例 #8
0
ファイル: ShopCtrTest.cs プロジェクト: MrBigBoy/BestilNemt
 public void AddShopTest([PexAssumeUnderTest] ShopCtr target, Shop shop)
 {
     target.AddShop(shop);
     // TODO: add assertions to method ShopCtrTest.AddShopTest(ShopCtr, Shop)
 }