Пример #1
0
        public void CarBrandDoorTest11()
        {
            CarBrand  brand = CreateCarBrand(100);
            BrandDoor door  = new BrandDoor(1)
            {
                Name = "BrandDoor", OrderIndex = 10
            };

            brand.AddMyDoor(door);
            brand.AddOtherDoor(door);

            AddCarBrand(brand);

            CheckDoorAssociatedCount(door.Id, 2);

            brand.AddOtherDoor(door);
            UpdateCarBrand(brand);

            CheckDoorAssociatedCount(door.Id, 3);

            brand.RemoveOtherDoor(door);
            UpdateCarBrand(brand);
            CheckDoorAssociatedCount(door.Id, 2);

            CheckExist(door.Id, true);
        }
Пример #2
0
        public void CarBrandDoorTest13()
        {
            CarBrand  brand = CreateCarBrand(100);
            BrandDoor door  = new BrandDoor(1)
            {
                Name = "BrandDoor", OrderIndex = 10
            };

            brand.OneDoor = door;
            AddCarBrand(brand);

            CheckDoorAssociatedCount(door.Id, 1);

            brand.AddOtherDoor(door);
            UpdateCarBrand(brand);

            CheckDoorAssociatedCount(door.Id, 2);

            brand.AddMyDoor(door);
            UpdateCarBrand(brand);

            CheckDoorAssociatedCount(door.Id, 3);

            brand.OtherDoor = door;
            UpdateCarBrand(brand);

            CheckDoorAssociatedCount(door.Id, 4);
        }