public void ParseArguments( string args, string[] extensionKeys, string[] extensionValues, string[] keys, string[] blocks) { var subject = new BaseFormatterImpl(); var req = new FormatterRequest(new Literal(1, 1, 1, 1, new StringBuilder()), string.Empty, null, args); var actual = subject.ParseArguments(req); Assert.Equal(extensionKeys.Length, actual.Extensions.Count()); Assert.Equal(keys.Length, actual.KeyedBlocks.Count()); for (int i = 0; i < actual.Extensions.ToArray().Length; i++) { var extension = actual.Extensions.ToArray()[i]; Assert.Equal(extensionKeys[i], extension.Extension); Assert.Equal(extensionValues[i], extension.Value); } for (int i = 0; i < actual.KeyedBlocks.ToArray().Length; i++) { var block = actual.KeyedBlocks.ToArray()[i]; Assert.Equal(keys[i], block.Key); Assert.Equal(blocks[i], block.BlockText); } }
public void ParseArguments_invalid(string args) { var subject = new BaseFormatterImpl(); var req = new FormatterRequest(new Literal(1, 1, 1, 1, new StringBuilder()), string.Empty, null, args); var ex = Assert.Throws <MalformedLiteralException>(() => subject.ParseArguments(req)); this.outputHelper.WriteLine(ex.Message); }
public void ParseArguments_invalid(string args) { var subject = new BaseFormatterImpl(); var req = new FormatterRequest(new Literal(1, 1, 1, 1, new StringBuilder()), null, null, args); var ex = Assert.Throws<MalformedLiteralException>(() => subject.ParseArguments(req)); this.outputHelper.WriteLine(ex.Message); }
public void ParseArguments( string args, string[] extensionKeys, string[] extensionValues, string[] keys, string[] blocks) { var subject = new BaseFormatterImpl(); var req = new FormatterRequest(new Literal(1, 1, 1, 1, new StringBuilder()), null, null, args); var actual = subject.ParseArguments(req); Assert.Equal(extensionKeys.Length, actual.Extensions.Count()); Assert.Equal(keys.Length, actual.KeyedBlocks.Count()); for (int i = 0; i < actual.Extensions.ToArray().Length; i++) { var extension = actual.Extensions.ToArray()[i]; Assert.Equal(extensionKeys[i], extension.Extension); Assert.Equal(extensionValues[i], extension.Value); } for (int i = 0; i < actual.KeyedBlocks.ToArray().Length; i++) { var block = actual.KeyedBlocks.ToArray()[i]; Assert.Equal(keys[i], block.Key); Assert.Equal(blocks[i], block.BlockText); } }