public void NoId_Throw() { var assembly = typeof(LibraTests).Assembly; var loader = new JsonLoader(_logger); loader.Register(_allTypes); var resource = assembly.GetManifestResourceNames().First(r => r.EndsWith("no_id.json")); var stream = assembly.GetManifestResourceStream(resource); Throws <ResourceSystemException>(() => loader.Parse(stream)); }
private List <Resource> LoadAll() { var assembly = typeof(LibraTests).Assembly; var loader = new JsonLoader(_logger); loader.Register(_allTypes); var result = new List <Resource>(); foreach (string res in assembly.GetManifestResourceNames()) { if (res.EndsWith(".rs")) { _logger.LogInfo($"Parsing: {res}"); var resource = loader.Parse(assembly.GetManifestResourceStream(res)); result.Add(resource); } } return(result); }