Пример #1
0
        public VerifiedChanges VerifyWith(RoadNetworkView view)
        {
            var context = new VerificationContext(view, this);

            return(_changes.Aggregate(
                       VerifiedChanges.Empty,
                       (verifiedChanges, requestedChange) => verifiedChanges.Append(requestedChange.Verify(context))));
        }
Пример #2
0
        public void RestoreFromSnapshot(RoadNetworkSnapshot snapshot)
        {
            if (snapshot == null)
            {
                throw new ArgumentNullException(nameof(snapshot));
            }

            _view = RoadNetworkView.Empty.RestoreFromSnapshot(snapshot);
        }
Пример #3
0
        private RoadNetwork()
        {
            _view = RoadNetworkView.Empty;

            On <ImportedRoadNode>(e =>
            {
                _view = _view.Given(e);
            });

            On <ImportedGradeSeparatedJunction>(e =>
            {
                _view = _view.Given(e);
            });

            On <ImportedRoadSegment>(e =>
            {
                _view = _view.Given(e);
            });

            On <RoadNetworkChangesBasedOnArchiveAccepted>(e =>
            {
                _view = _view.Given(e);
            });
        }
 public VerificationContext(RoadNetworkView view, IRequestedChangeIdentityTranslator translator)
 {
     View       = view ?? throw new ArgumentNullException(nameof(view));
     Translator = translator ?? throw new ArgumentNullException(nameof(translator));
     Tolerance  = 0.001; // 1 mm
 }