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>(); }
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"); }