Esempio n. 1
0
        public void Caching_Should_Perform_Decently_With_Many_Opens_And_Writes()
        {
            for (var i = 0; i < 1000; i++)
            {
                var storage = new Cactus.Blade.Caching.Caching();
                storage.Store(Guid.NewGuid().ToString(), i);
                storage.Persist();
            }

            var store = new Cactus.Blade.Caching.Caching();

            store.Destroy();
        }
Esempio n. 2
0
        public void Caching_Destroy_Should_Delete_File_On_Disk()
        {
            var random_filename = Guid.NewGuid().ToString("N");
            var filepath        = Cactus.Blade.Caching.Helper.FileHelpers.GetLocalStoreFilePath(random_filename);
            var config          = new CachingConfiguration()
            {
                Filename = random_filename
            };

            var storage = new Cactus.Blade.Caching.Caching(config);

            storage.Persist();

            storage.Destroy();

            File.Exists(filepath).Should().BeFalse();
        }
Esempio n. 3
0
        public void Caching_Should_Perform_Decently_With_Large_Collections()
        {
            var stopwatch = Stopwatch.StartNew();
            var storage   = new Cactus.Blade.Caching.Caching();

            for (var i = 0; i < 100000; i++)
            {
                storage.Store(Guid.NewGuid().ToString(), i);
            }

            storage.Persist();

            var target = new Cactus.Blade.Caching.Caching();

            target.Clear();
            stopwatch.Stop();

            target.Destroy();

            stopwatch.ElapsedMilliseconds.Should().BeLessOrEqualTo(1000);
        }