Esempio 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);
        }
Esempio n. 2
0
        public void CarBrandTest7()
        {
            CarBrand       brand = CreateCarBrand(100);
            BrandAccessory acc   = new BrandAccessory("CarBrand配饰", 10, new DateTime(2017, 6, 1));

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

            AddCarBrand(brand);

            CheckAccessoryAssociatedCount(acc.Id, 2);

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

            CheckAccessoryAssociatedCount(acc.Id, 1);

            CheckExist(acc.Id, true);
        }