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); }
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); }
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); }
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); }
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); }
public void RemoveYouAccessory(BrandAccessory accessory) { _YouAccessories.Remove(accessory); }
public void AddYouAccessory(BrandAccessory accessory) { _YouAccessories.Add(accessory); }
public void RemoveMyAccessory(BrandAccessory accessory) { _MyAccessories.Remove(accessory); }
public void AddMyAccessory(BrandAccessory accessory) { _MyAccessories.Add(accessory); }