Пример #1
0
        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);
        }
Пример #2
0
        public void ToString_EqualsExpectedResult(QuarterTestItem <string> quarterTestItem)
        {
            var quarter   = quarterTestItem.Create();
            var formatted = quarter.ToString();

            Assert.AreEqual(quarterTestItem.ExpectedResult, formatted);
        }
Пример #3
0
        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);
        }
Пример #4
0
 public void Constructor_WithQuarterOfYearParameterOutOfRange_ThrowsArgumentOutOfRangeException(QuarterTestItem quarterTestItem)
 {
     // ReSharper disable once ObjectCreationAsStatement
     Assert.Throws <ArgumentOutOfRangeException>(() => quarterTestItem.Create());
 }
Пример #5
0
        public void YearProperty_EqualsYearUsedToConstruct(QuarterTestItem quarterTestItem)
        {
            var quarter = quarterTestItem.Create();

            Assert.AreEqual(quarterTestItem.YearNum, quarter.Year);
        }
Пример #6
0
        public void End_AsExpected(QuarterTestItem <DateTime> quarterTestItem)
        {
            var quarter = quarterTestItem.Create();

            Assert.AreEqual(quarterTestItem.ExpectedResult, quarter.End);
        }