public void Parse_ValidParse_ElementEqualsExpected <TSet, TStruct, TParser> ( TSet hack1, TStruct hack2, TParser hack3, MatrixParser <TSet, TStruct, TParser> parser, String inputString, Matrix <TSet, TStruct> expected) where TStruct : IStructure, new() where TParser : IParser <TSet>, new() { var result = parser.Parse(inputString); Assert.IsNotNull(result); Assert.AreEqual(expected, result); }
public Matrix(string input) { items = parser.Parse(input); rows = items.Length; columns = (items.FirstOrDefault() ?? throw new Exception("The matrix is empty.")).Length; }