public void ThenTheResultSummaryNotificationsHasOneNotificationWith(Table table) { var summary = ScenarioContext.Current.Get <IResultSummary>(); var notifications = summary.Notifications; notifications.Count.Should().BeGreaterOrEqualTo(1); var notification = notifications[0]; foreach (var row in table.Rows) { var actual = GetPropertyValue(notification, row[0]); if (row[1] == "{\"offset\": 0,\"line\": 1,\"column\": 1}") { actual.Should().BeOfType <InputPosition>(); IInputPosition pos = (IInputPosition)actual; pos.Offset.Should().Be(0); pos.Line.Should().Be(1); pos.Column.Should().Be(1); } else if (row[1].StartsWith("\"") && row[1].EndsWith("\"")) { row[1].Substring(1, row[1].Length - 2).Should().Be(actual.ToString()); } else { throw new InvalidOperationException($"Cannot understand value {row[1]} in the feature file."); } } }
public Notification(string code, string title, string description, IInputPosition position, string severity) { Code = code; Title = title; Description = description; Position = position; Severity = severity; }