Пример #1
0
        public void TestSetup()
        {
            _folder = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
            Directory.CreateDirectory(_folder);

            var cacheFolder = Path.Combine(_folder, "Cache");

            Directory.CreateDirectory(cacheFolder);

            // override configuration
            var config = UQConfiguration.Instance as UQConfiguration;

            config.HorizontalCacheConfigurationSection.SetParameter("folder", cacheFolder);
            config.HorizontalCacheConfigurationSection.ProviderType = typeof(TestTextFileCacheProvider <>);
            config.HorizontalCacheConfigurationSection.IsEnabled    = true;


            // create 1000 files for testing
            var dao = new DummyEntityDAO2();

            dao.SetProperties(new Dictionary <string, object>
            {
                ["folder"] = _folder
            });

            dao.GenerateFiles(1000);

            // forces the cache initialization
            var context = new DummyContext(_folder);

            context.DummyEntitiesWithCache.Select(x => x.Key).ToList();
        }
Пример #2
0
        public static void Setup(TestContext testContext)
        {
            Directory.CreateDirectory(@"C:\Tests");
            Directory.CreateDirectory(@"C:\Tests\DataSource");

            var dao = new DummyEntityDAO2();

            dao.SetProperties(new Dictionary <string, object>
            {
                ["folder"] = @"C:\Tests\DataSource"
            });

            dao.GenerateFiles(100000);
        }