public void Parse_EqualsExpectedResult(QuarterTestItem <string> quarterTestItem) { var quarterFromText = Quarter.Parse(quarterTestItem.ExpectedResult); // TODO bad use of Expected result? var expectedQuarter = quarterTestItem.Create(); Assert.AreEqual(expectedQuarter, quarterFromText); }
public void ToString_EqualsExpectedResult(QuarterTestItem <string> quarterTestItem) { var quarter = quarterTestItem.Create(); var formatted = quarter.ToString(); Assert.AreEqual(quarterTestItem.ExpectedResult, formatted); }
public void Deconstruct_ReturnsComponentsUsedToConstruct(QuarterTestItem testItem) { var quarter = testItem.Create(); (int year, int quarterOfYear) = quarter; Assert.AreEqual(testItem.YearNum, year); Assert.AreEqual(testItem.QuarterOfYear, quarterOfYear); }
public void Constructor_WithQuarterOfYearParameterOutOfRange_ThrowsArgumentOutOfRangeException(QuarterTestItem quarterTestItem) { // ReSharper disable once ObjectCreationAsStatement Assert.Throws <ArgumentOutOfRangeException>(() => quarterTestItem.Create()); }
public void YearProperty_EqualsYearUsedToConstruct(QuarterTestItem quarterTestItem) { var quarter = quarterTestItem.Create(); Assert.AreEqual(quarterTestItem.YearNum, quarter.Year); }
public void End_AsExpected(QuarterTestItem <DateTime> quarterTestItem) { var quarter = quarterTestItem.Create(); Assert.AreEqual(quarterTestItem.ExpectedResult, quarter.End); }