public void Init() { var config = new CommonConfig(); var commandConfig = new BFCommandConfig(); this._executer = new TestExecuter(config, commandConfig); }
public BFAnalyzer(CommonConfig commonConfig, BFCommandConfig commandConfig) { this._config = commandConfig; this._definedCommands = commandConfig.GetCommands().ToList(); var parserFactory = new ParserFactory(commandConfig); this._parser = parserFactory.Create(commonConfig.EnableCommentOut); }
public void SerializeCorrectlyTest() { var src = new BFCommandConfig { Increment = new BFCommand("inc", BFCommandType.Increment), Decrement = new BFCommand("dec", BFCommandType.Decrement), MoveRight = new BFCommand("moveR", BFCommandType.MoveRight), MoveLeft = new BFCommand("moveL", BFCommandType.MoveLeft), LoopHead = new BFCommand("loopH", BFCommandType.LoopHead), LoopTail = new BFCommand("loopT", BFCommandType.LoopTail), Read = new BFCommand("read", BFCommandType.Read), Write = new BFCommand("write", BFCommandType.Write), BeginComment = new BFCommand("beginC", BFCommandType.BeginComment), EndComment = new BFCommand("endC", BFCommandType.EndComment) }; var expectedFile = @"TestData\BFCommandConfigJsons\Expected.json"; ConfigManager.Save(src, this._destPath); FileAssert.AreEqual(expectedFile, this._destPath); }
public void DeserializeCorrectlyObsoleteTest() { var jsonPath = @"TestData\BFCommandConfigJsons\Obsolete.json"; var expected = new BFCommandConfig { Increment = new BFCommand("inc", BFCommandType.Increment), Decrement = new BFCommand("dec", BFCommandType.Decrement), MoveRight = new BFCommand("moveR", BFCommandType.MoveRight), MoveLeft = new BFCommand("moveL", BFCommandType.MoveLeft), LoopHead = new BFCommand("roopH", BFCommandType.LoopHead), LoopTail = new BFCommand("roopT", BFCommandType.LoopTail), Read = new BFCommand("read", BFCommandType.Read), Write = new BFCommand("write", BFCommandType.Write), BeginComment = new BFCommand("beginC", BFCommandType.BeginComment), EndComment = new BFCommand("endC", BFCommandType.EndComment) }; var result = ConfigManager.Import <BFCommandConfig>(jsonPath); result.IsStructuralEqual(expected); }
public Executer(CommonConfig config, BFCommandConfig commandConfig) : base(config, commandConfig) { }
public BFDefaultParser(BFCommandConfig config) { this._definedCommands = config.GetCommands().ToList(); }
public BFIgnoreCommentOutParser(BFCommandConfig config) { this._definedCommands = config.GetCommands().ToList(); }
public BrainfxxkExecuter(CommonConfig config, BFCommandConfig commandConfig) : base(config, commandConfig) { }
public ParserFactory(BFCommandConfig commandConfig) { this._commandConfig = commandConfig; }
protected ExecuterBase(CommonConfig config, BFCommandConfig commandConfig) { this._config = config; this._analyzer = new BFAnalyzer(config, commandConfig); }