public void ThenUsingGetWithKeyNOnTheSingleRecordGives(string key, Table table) { var result = ScenarioContext.Current.Get <IStatementResult>(); var record = result.Single(); var actual = record[key]; var expected = _parser.Parse(table.Rows[0][0]); Assert.True(TckUtil.CypherValueEquals(actual, expected)); }
public void ThenUsingValuesOnTheSingleRecordGives(Table table) { var result = ScenarioContext.Current.Get <IStatementResult>(); var values = result.Single().Values; var expectedValues = table.Rows.Select(row => _parser.Parse(row[0])).Select(expected => expected).Cast <object>().ToList(); while (expectedValues.Count > 0) { var expected = expectedValues.First(); var size = expectedValues.Count; foreach (var real in values.Values) { if (TckUtil.CypherValueEquals(expected, real)) { expectedValues.Remove(expected); break; } } if (size == expectedValues.Count) { throw new Exception($"Failed to found {expected}"); } } }