public void MostRecentDateEvent_When_NoDomainDates_Then_ReturnsUtcDate() { // arrange var underTest = new DealerOrder( A.Fake <IFinancialInstrument>(), string.Empty, string.Empty, null, null, null, null, null, null, null, string.Empty, string.Empty, string.Empty, string.Empty, OrderTypes.LIMIT, OrderDirections.BUY, new Currency("GBP"), new Currency("USD"), OrderCleanDirty.NONE, null, string.Empty, string.Empty, string.Empty, null, null, null, null, null, null, OptionEuropeanAmerican.NONE); // act var before = DateTime.UtcNow; var actual = underTest.MostRecentDateEvent(); var after = DateTime.UtcNow; // assert Assert.True(before <= actual); // allows for time to pass in test execution Assert.True(after >= actual); Assert.AreEqual(DateTimeKind.Utc, actual.Kind); }
public void MostRecentDateEvent_When_PlacedDateOnly_Then_ReturnsPlacedDate() { // arrange var placedDate = new DateTime(2019, 1, 1, 1, 1, 1); var underTest = new DealerOrder( A.Fake <IFinancialInstrument>(), string.Empty, string.Empty, placedDate, null, null, null, null, null, null, string.Empty, string.Empty, string.Empty, string.Empty, OrderTypes.LIMIT, OrderDirections.BUY, new Currency("GBP"), new Currency("USD"), OrderCleanDirty.NONE, null, string.Empty, string.Empty, string.Empty, null, null, null, null, null, null, OptionEuropeanAmerican.NONE); // act var actual = underTest.MostRecentDateEvent(); // assert Assert.AreEqual(placedDate, actual); }