Exemplo n.º 1
0
        public void ToString_EqualsExpectedResult(HalfHourTestItem <string> testItem)
        {
            var halfHour  = testItem.Create();
            var formatted = halfHour.ToString();

            Assert.AreEqual(testItem.ExpectedResult, formatted);
        }
Exemplo n.º 2
0
        public void Parse_EqualsExpectedResult(HalfHourTestItem <string> testItem)
        {
            var halfHourFromText = HalfHour.Parse(testItem.ExpectedResult); // TODO bad use of Expected result?
            var expectedHalfHour = testItem.Create();

            Assert.AreEqual(expectedHalfHour, halfHourFromText);
        }
Exemplo n.º 3
0
        public void Deconstruct_ReturnsComponentsUsedToConstruct(HalfHourTestItem testItem)
        {
            var hour = testItem.Create();

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