예제 #1
0
파일: Current.cs 프로젝트: repos-css/More
        public Context(FileCache cache)
        {
            FileCache = cache;

            SpriteFiles = new List<string>();
            InfoMessages = new List<string>();
            Errors = new Dictionary<ErrorType, List<Error>>();
            Warnings = new Dictionary<ErrorType, List<Error>>();
            WriterMode = MoreInternals.WriterMode.Pretty;
            Options = MoreInternals.Options.None;
            PendingSpriteExports = new List<SpriteExport>();
        }
예제 #2
0
        public void FileCache()
        {
            var cache = new FileCache();

            Func<string, List<Block>> delayLoad = (path) => { Thread.Sleep(100); return new List<Block>(); };
            Func<string, List<Block>> error = (path) => { throw new InvalidOperationException(); };

            cache.Demand("test1", delayLoad);
            Assert.IsTrue(cache.Available(new[] { "test1" }, error).Item1 == "test1");
            Assert.IsTrue(cache.Loaded().Contains("test1"));

            Assert.IsTrue(cache.Available(new[] { "test2", "test1" }, error).Item1 == "test1");
        }