public void DeleteWithSimple() { Location location = Util.CreateLocation("武汉"); var cmd = new DeleteLocation(location.Id); cmd.Execute(); Util.AssertNotExistLocation(location.Id); }
public void DeleteWithParentAndChild() { Location chinese = Util.CreateLocation("中国"); Location hubei = Util.CreateLocation("湖北省", chinese.Id); Location wuhan = Util.CreateLocation("武汉", hubei.Id); Location hanyang = Util.CreateLocation("汉阳区", wuhan.Id); var hubeiLR = Util.GetLocationLR(hubei.Id); var count = Util.GetLocationAllChildsCount(hubeiLR); Assert.IsTrue(count == 2); var cmd = new DeleteLocation(hubei.Id); cmd.Execute(); count = Util.GetLocationAllChildsCount(hubeiLR); Assert.AreEqual(0, count); Util.AssertNotExistLocation(hubei.Id); Util.AssertNotExistLocation(wuhan.Id); Util.AssertNotExistLocation(hanyang.Id); }