示例#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);
        }
示例#2
0
        public void CarBrandTest1()
        {
            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.BrandAccessory = BrandAccessory.Empty;
            UpdateCarBrand(brand);

            CheckExist(acc.Id, false);
        }
示例#3
0
        public void CarBrandTest6()
        {
            CarBrand       brand = CreateCarBrand(100);
            BrandAccessory acc   = new BrandAccessory("CarBrand配饰", 10, new DateTime(2017, 6, 1));

            brand.AddMyAccessory(acc);

            AddCarBrand(brand);

            CheckAccessoryAssociatedCount(acc.Id, 1);

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

            CheckExist(acc.Id, false);
        }
示例#4
0
        public void CarBrandTest15()
        {
            BrandAccessory acc = new BrandAccessory("CarBrand1配饰", 10, new DateTime(2017, 6, 1));

            CarBrand brand1 = CreateCarBrand(100);

            brand1.BrandAccessory = acc;
            AddCarBrand(brand1);

            CheckAccessoryAssociatedCount(acc.Id, 1);

            CarBrand brand2 = CreateCarBrand(101);

            brand2.BrandAccessory = acc;
            AddCarBrand(brand2);

            //CheckAccessoryAssociatedCount(acc.Id, 2);
        }
示例#5
0
        public void CarBrandTest5()
        {
            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.OtherAccessory = acc;
            UpdateCarBrand(brand);

            CheckAccessoryAssociatedCount(acc.Id, 2);

            CheckExist(acc.Id, true);
        }
示例#6
0
 public void RemoveYouAccessory(BrandAccessory accessory)
 {
     _YouAccessories.Remove(accessory);
 }
示例#7
0
 public void AddYouAccessory(BrandAccessory accessory)
 {
     _YouAccessories.Add(accessory);
 }
示例#8
0
 public void RemoveMyAccessory(BrandAccessory accessory)
 {
     _MyAccessories.Remove(accessory);
 }
示例#9
0
 public void AddMyAccessory(BrandAccessory accessory)
 {
     _MyAccessories.Add(accessory);
 }