public Region(Location location, IHistoryManager<Region> historyManager = null) { Location = location; HistoryManager = historyManager; AfterAddBizEntity += new EventHandler<BizEntityEventArg>(DefaultAddBizEntityHandler); AfterRemoveBizEntity += new EventHandler<BizEntityEventArg>(DefaultRemoveBizEntityHandler); }
public void DestinationToTest() { Location target = new Location(1,2); // TODO: инициализация подходящего значения Location anotherLoc = new Location(4,7); // TODO: инициализация подходящего значения double expected = Math.Sqrt(34); // TODO: инициализация подходящего значения double actual; actual = target.DestinationTo(anotherLoc); Assert.AreEqual(expected, actual); }
public double DestinationTo(Location anotherLoc) { return Math.Sqrt(Math.Pow(X - anotherLoc.X, 2) + Math.Pow(Y - anotherLoc.Y, 2)); }