public static IDemoParser GetDemoParser(string demoFile) { IDemoParser[] parsers = new IDemoParser[] { new CldDemoParser(demoFile) }; return(parsers.FirstOrDefault(x => x.CanParse())); }
public void TestCldDemoParserFile() { string file = "zandemo.cld"; File.Copy(Path.Combine("Resources", file), file, true); IDemoParser parser = DemoUtil.GetDemoParser(file); Assert.IsNotNull(parser); string[] files = parser.GetRequiredFiles(); Assert.AreEqual("doom2.wad", files[0]); Assert.AreEqual("pyrrhic_.wad", files[1]); }