From f679ec294eafe77df1fc3b2a436777d3123ff4a7 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Mon, 12 Feb 2024 02:35:17 +0000 Subject: [PATCH] fix(tests): add test to fix coverage on DateOnly.Deconstruct --- X10D.Tests/src/Time/DateOnlyTests.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/X10D.Tests/src/Time/DateOnlyTests.cs b/X10D.Tests/src/Time/DateOnlyTests.cs index 15b10ce..25dc25d 100644 --- a/X10D.Tests/src/Time/DateOnlyTests.cs +++ b/X10D.Tests/src/Time/DateOnlyTests.cs @@ -39,6 +39,18 @@ internal class DateOnlyTests Assert.That(age, Is.EqualTo(18)); } + [Test] + public void Deconstruct_ShouldDeconstruct_GivenDateOnly() + { + var date = new DateOnly(2017, 12, 31); + + date.Deconstruct(out int year, out int month, out int day); + + Assert.That(year, Is.EqualTo(2017)); + Assert.That(month, Is.EqualTo(12)); + Assert.That(day, Is.EqualTo(31)); + } + [Test] public void Deconstruct_ShouldDeconstructToTuple_GivenDateOnly() {