Thanks for your interest. My example looks like this:
Given I have the following fert events:
| Date | Name | Makeup | Paddocks | Application Rate |
| 10 days ago | Urea | 1, 2, 3, 4, 5, 6 | busy | 100 |
| 10 days ago | DAP | 2, 3, 4, 5, 6, 7 | busy | 1000 |
And I can view paddock history
And I am signed in
When I a view the paddock history for paddock 'busy'
Then I see the following paddock history events:
| Date | Particulars line 1 | Amount |
| 10 days ago | Urea | 100 kg/ha |
| 10 days ago | DAP | 1000 kg/ha |
And the step looks like this:
[Then(@"I see the following paddock history events:")]
public void ThenISeeTheFollowingPaddockHistoryEvents(Table table)
{
// Convert table to a strongly-typed row set
var expectedEventRows = table.CreateSet<PaddockHistoryTableRow>();
// Process the relative date strings into real dates
// (this is where Step Argument Transforms on the table cells would be awesome)
var expectedEventsWithActualDates = expectedEventRows.Select(r => new
{
Date = r.Date.ParseRelativeDayDescription(),
ParticularsLine1 = r.ParticularsLine1,
Amount = r.Amount
}).ToList();
// Get my actuals
var actualEvents = _paddockHistoryWizard.EventsPane.PaddockHistoryEvents;
// Manually compare actuals with expecteds
Assert.AreEqual(expectedEventsWithActualDates.Count, actualEvents.Count);
foreach (var expected in expectedEventsWithActualDates)
{
Assert.IsTrue(actualEvents.Any(actual =>
actual.Amount == expected.Amount
&& actual.Date == expected.Date
&& actual.ParticularsLine1 == expected.ParticularsLine1));
}
}
Hope that is inspiring :)
Cheers,
Darren B.