Ejemplo n.º 1
0
        public void CarBrandTest13()
        {
            CarBrand       brand = CreateCarBrand(100);
            BrandAccessory acc   = new BrandAccessory("CarBrand配饰", 10, new DateTime(2017, 6, 1));

            brand.BrandAccessory = acc;
            AddCarBrand(brand);

            CheckAccessoryAssociatedCount(acc.Id, 1);

            brand.AddYouAccessory(acc);
            UpdateCarBrand(brand);

            CheckAccessoryAssociatedCount(acc.Id, 2);

            brand.AddMyAccessory(acc);
            UpdateCarBrand(brand);

            CheckAccessoryAssociatedCount(acc.Id, 3);

            brand.OtherAccessory = acc;
            UpdateCarBrand(brand);

            CheckAccessoryAssociatedCount(acc.Id, 4);
        }
Ejemplo n.º 2
0
        public void CarBrandTest10()
        {
            CarBrand       brand = CreateCarBrand(100);
            BrandAccessory acc   = new BrandAccessory("CarBrand配饰", 10, new DateTime(2017, 6, 1));

            brand.AddMyAccessory(acc);
            brand.AddYouAccessory(acc);

            AddCarBrand(brand);

            CheckAccessoryAssociatedCount(acc.Id, 2);

            brand.RemoveMyAccessory(acc);
            UpdateCarBrand(brand);

            CheckAccessoryAssociatedCount(acc.Id, 1);

            brand.RemoveYouAccessory(acc);
            UpdateCarBrand(brand);

            CheckExist(acc.Id, false);
        }