Ejemplo n.º 1
0
        public void PathsCanBeRetrievedByKeyAfterOpen()
        {
            var tags = new[]
            {
                "alpha", "beta", "charlie", "delta", "echo", "foxtrot", "golf"
            };

            var id = 0;

            for (var ix = 0; ix < tags.Length; ix++)
            {
                id = _cache.AddOrGet(tags.Take(ix + 1));
            }

            var opened = new PathsCache(_tags);

            _cache.Dispose();

            _cache = opened;
            opened.Open(_path);

            var path = _cache.Get(id);

            Assert.That(path, Is.EqualTo(new [] { 2, 3, 4, 5, 6, 7, 8 }));
        }
Ejemplo n.º 2
0
        public void PathsAreLoadedOnOpen()
        {
            var tags = new[]
            {
                "alpha", "beta", "charlie", "delta", "echo", "foxtrot", "golf"
            };

            for (int ix = 0; ix < tags.Length; ix++)
            {
                _cache.AddOrGet(tags.Take(ix + 1));
            }

            var opened = new PathsCache(_tags);

            _cache.Dispose();

            _cache = opened;
            opened.Open(_path);

            var result = LoadPaths(opened);

            Console.WriteLine(result);
            Approvals.Verify(result);
        }