예제 #1
0
        public void Snap(string snapshotName, object newSnapValue)
        {
            var path        = _pathResolver.ResolvePath(snapshotName);
            var oldSnapshot = _store.GetSnap(path);

            if (oldSnapshot != null)
            {
                AssertSnapshot(path, newSnapValue, oldSnapshot);
                return;
            }

            if (_snapUpdateDecider.ShouldUpdateSnap())
            {
                _store.StoreSnap(path, newSnapValue);
                _asserter.AssertEqual();
                return;
            }

            _asserter.AssertNotEqual("A snapshot for this does not exist yet.");
        }