public void Parse_OneCommandWithTwoParams_CommandExtracted() { var parser = new ZebraScanner(); var tokens = parser.Scan(@"^BBarg1,arg2"); Assert.AreEqual("BB", tokens.First().Command); }
public void Parse_OneCommandWithTwoParams_TwoParams() { var parser = new ZebraScanner(); var tokens = parser.Scan(@"^BBarg1,arg2"); Assert.AreEqual(2, tokens.First().Parameters.Count()); }
public void Parse_OneCommandWithTwoParams_OneToken() { var parser = new ZebraScanner(); var tokens = parser.Scan(@"^AAarg1,arg2"); Assert.AreEqual(1, tokens.Count()); }
public void Parse_Tilde_ExtractedAsCommand() { var parser = new ZebraScanner(); var tokens = parser.Scan(@"~JR"); var token = tokens.First(); Assert.AreEqual("JR", token.Command); }
public void Parse_OneLetterCommand_CommandExtracted() { var parser = new ZebraScanner(); var tokens = parser.Scan(@"^Aarg1,arg2"); var token = tokens.First(); Assert.AreEqual("A", token.Command); }
public void Parse_OneCommandWithTwoParams_ParamsExtracted() { var parser = new ZebraScanner(); var tokens = parser.Scan(@"^BBarg1,arg2"); var token = tokens.First(); Assert.AreEqual("arg1", token.Parameters[0]); Assert.AreEqual("arg2", token.Parameters[1]); }
public async Task <Label> CreateAsync(string label) { var scanner = new ZebraScanner(); var tokens = scanner.Scan(label); var parser = new ZebraParser(); var concreteLabel = parser.Parse(tokens); return(await Task.FromResult(concreteLabel)); }
public void TestMethod1() { var scanner = new ZebraScanner(); var content = File.ReadAllText("TestLabel.txt"); var tokens = scanner.Scan(content); var parser = new ZebraParser(); var label = parser.Parse(tokens); Assert.IsNotNull(label); }
public void ParseTestLabel_ShouldParseCommands() { var parser = new ZebraScanner(); var label = File.ReadAllText("TestLabel.txt"); var tokens = parser.Scan(label); }