Example #1
0
        public void ToString_EqualsExpectedResult(HourTestItem <string> hourTestItem)
        {
            var day       = hourTestItem.Create();
            var formatted = day.ToString();

            Assert.AreEqual(hourTestItem.ExpectedResult, formatted);
        }
Example #2
0
        public void Parse_EqualsExpectedResult(HourTestItem <string> hourTestItem)
        {
            var dayFromText = Hour.Parse(hourTestItem.ExpectedResult); // TODO bad use of Expected result?
            var expectedDay = hourTestItem.Create();

            Assert.AreEqual(expectedDay, dayFromText);
        }
Example #3
0
        public void Deconstruct_ReturnsComponentsUsedToConstruct(HourTestItem testItem)
        {
            var hour = testItem.Create();

            (int year, int monthOfYear, int dayOfMonth, int hourOfDay) = hour;
            Assert.AreEqual(testItem.YearNum, year);
            Assert.AreEqual(testItem.MonthOfYear, monthOfYear);
            Assert.AreEqual(testItem.DayOfMonth, dayOfMonth);
            Assert.AreEqual(testItem.HourOfDay, hourOfDay);
        }