DateTemp column

This commit is contained in:
Chika 2020-10-15 13:16:34 +03:00
parent 111696b488
commit 1979239cdd
4 changed files with 282 additions and 48 deletions

View File

@ -39,6 +39,7 @@
<e p="bin" t="ExcludeRecursive" />
<e p="Columns" t="Include">
<e p="DateColumn.cs" t="Include" />
<e p="DateTempColumn.cs" t="Include" />
</e>
<e p="EvoCalculator.Core.Calculation.csproj" t="IncludeRecursive" />
<e p="FinanceFormulas" t="Include">
@ -105,6 +106,7 @@
<e p="Suite" t="Include">
<e p="Columns" t="Include">
<e p="DateColumnTests.cs" t="Include" />
<e p="DateTempTests.cs" t="Include" />
</e>
<e p="FinanceFormulasTests.cs" t="Include" />
</e>

View File

@ -14,9 +14,10 @@
</component>
<component name="ChangeListManager">
<list default="true" id="2c3b0650-5589-43d4-b4b7-2979612bb30f" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/DateTempColumn.cs" afterDir="false" />
<change afterPath="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Suite/Columns/DateTempTests.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.idea.EvoCalculator.Core/.idea/contentModel.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.EvoCalculator.Core/.idea/contentModel.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/.idea.EvoCalculator.Core/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/.idea.EvoCalculator.Core/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/DateColumn.cs" beforeDir="false" afterPath="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/DateColumn.cs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Suite/Columns/DateColumnTests.cs" beforeDir="false" afterPath="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Suite/Columns/DateColumnTests.cs" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -28,9 +29,11 @@
</component>
<component name="HighlightingSettingsPerFile">
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/18D5A60D-361A-4AFD-A431-F772FA87FCC3/d9/b0109e6d/TestInvoker`1.cs" root0="SKIP_HIGHLIGHTING" />
<setting file="mock://C:/Users/Chika/Projects/EvoCalculator.Core/EvoCalculator.Core.Tests/Calculation/Suite/Columns/DateColumnTests.cs" root0="SKIP_HIGHLIGHTING" />
<setting file="file://$PROJECT_DIR$/EvoCalculator.Core.Constants/Calculation.cs" root0="FORCE_HIGHLIGHTING" />
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/9D995D4A-0EBE-4A93-85A6-BE06CB7C70EE/f6/ada9c10c/FactAttribute.cs" root0="SKIP_HIGHLIGHTING" />
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/9152434B-0FAC-463B-87F2-DD9AF798817F/2e/201d3c41/Assert.cs" root0="SKIP_HIGHLIGHTING" />
<setting file="mock://C:/Users/Chika/Projects/EvoCalculator.Core/EvoCalculator.Core.Calculation/Columns/DateColumn.cs" root0="SKIP_HIGHLIGHTING" />
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/SourcesCache/AD61CA47-F8B7-4CC6-93A0-BA44CC73B5C7/49/DateTime.cs" root0="SKIP_HIGHLIGHTING" />
</component>
<component name="IdeDocumentHistory">
@ -66,11 +69,13 @@
<option value="$PROJECT_DIR$/Constants/Class1.cs" />
<option value="$PROJECT_DIR$/Constants/Calculation/Constants.cs" />
<option value="$PROJECT_DIR$/EvoCalculator.Core.Constants/Calculation/Constants.cs" />
<option value="$PROJECT_DIR$/EvoCalculator.Core.Constants/Calculation.cs" />
<option value="$PROJECT_DIR$/EvoCalculator.Core.Models/Calculation/Interfaces/IColumn.cs" />
<option value="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Suite/ColumnsTests.cs" />
<option value="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/DateColumn.cs" />
<option value="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Suite/Columns/DateColumnTests.cs" />
<option value="$PROJECT_DIR$/EvoCalculator.Core.Constants/Calculation.cs" />
<option value="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Suite/Columns/DateTempTests.cs" />
<option value="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/DateTempColumn.cs" />
</list>
</option>
</component>
@ -135,7 +140,7 @@
<workItem from="1602504354370" duration="6573000" />
<workItem from="1602584653395" duration="12605000" />
<workItem from="1602678304213" duration="9304000" />
<workItem from="1602754684591" duration="1007000" />
<workItem from="1602754684591" duration="2094000" />
</task>
<task id="LOCAL-00001" summary="rename: flow">
<created>1602593830686</created>
@ -183,94 +188,94 @@
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="454" height="464" key="DebuggerActiveHint/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602687556127" />
<state width="2517" height="301" key="GridCell.Tab.0.bottom" timestamp="1602755114435">
<state width="2517" height="464" key="GridCell.Tab.0.bottom" timestamp="1602755691464">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="2517" height="301" key="GridCell.Tab.0.bottom/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755114435" />
<state width="2517" height="301" key="GridCell.Tab.0.center" timestamp="1602755114433">
<state width="2517" height="464" key="GridCell.Tab.0.bottom/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755691464" />
<state width="2517" height="464" key="GridCell.Tab.0.center" timestamp="1602755691462">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="2517" height="301" key="GridCell.Tab.0.center/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755114433" />
<state width="2517" height="301" key="GridCell.Tab.0.left" timestamp="1602755114432">
<state width="2517" height="464" key="GridCell.Tab.0.center/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755691462" />
<state width="2517" height="464" key="GridCell.Tab.0.left" timestamp="1602755691462">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="2517" height="301" key="GridCell.Tab.0.left/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755114432" />
<state width="2517" height="301" key="GridCell.Tab.0.right" timestamp="1602755114434">
<state width="2517" height="464" key="GridCell.Tab.0.left/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755691462" />
<state width="2517" height="464" key="GridCell.Tab.0.right" timestamp="1602755691463">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="2517" height="301" key="GridCell.Tab.0.right/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755114434" />
<state width="2517" height="301" key="GridCell.Tab.1.bottom" timestamp="1602755114436">
<state width="2517" height="464" key="GridCell.Tab.0.right/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755691463" />
<state width="2517" height="464" key="GridCell.Tab.1.bottom" timestamp="1602755691467">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="2517" height="301" key="GridCell.Tab.1.bottom/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755114436" />
<state width="2517" height="301" key="GridCell.Tab.1.center" timestamp="1602755114436">
<state width="2517" height="464" key="GridCell.Tab.1.bottom/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755691467" />
<state width="2517" height="464" key="GridCell.Tab.1.center" timestamp="1602755691466">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="2517" height="301" key="GridCell.Tab.1.center/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755114436" />
<state width="2517" height="301" key="GridCell.Tab.1.left" timestamp="1602755114435">
<state width="2517" height="464" key="GridCell.Tab.1.center/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755691466" />
<state width="2517" height="464" key="GridCell.Tab.1.left" timestamp="1602755691465">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="2517" height="301" key="GridCell.Tab.1.left/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755114435" />
<state width="2517" height="301" key="GridCell.Tab.1.right" timestamp="1602755114436">
<state width="2517" height="464" key="GridCell.Tab.1.left/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755691465" />
<state width="2517" height="464" key="GridCell.Tab.1.right" timestamp="1602755691467">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="2517" height="301" key="GridCell.Tab.1.right/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755114436" />
<state width="2517" height="301" key="GridCell.Tab.2.bottom" timestamp="1602755114440">
<state width="2517" height="464" key="GridCell.Tab.1.right/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755691467" />
<state width="2517" height="464" key="GridCell.Tab.2.bottom" timestamp="1602755691469">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="2517" height="301" key="GridCell.Tab.2.bottom/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755114440" />
<state width="2517" height="301" key="GridCell.Tab.2.center" timestamp="1602755114438">
<state width="2517" height="464" key="GridCell.Tab.2.bottom/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755691469" />
<state width="2517" height="464" key="GridCell.Tab.2.center" timestamp="1602755691468">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="2517" height="301" key="GridCell.Tab.2.center/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755114438" />
<state width="2517" height="301" key="GridCell.Tab.2.left" timestamp="1602755114437">
<state width="2517" height="464" key="GridCell.Tab.2.center/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755691468" />
<state width="2517" height="464" key="GridCell.Tab.2.left" timestamp="1602755691468">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="2517" height="301" key="GridCell.Tab.2.left/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755114437" />
<state width="2517" height="301" key="GridCell.Tab.2.right" timestamp="1602755114439">
<state width="2517" height="464" key="GridCell.Tab.2.left/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755691468" />
<state width="2517" height="464" key="GridCell.Tab.2.right" timestamp="1602755691468">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="2517" height="301" key="GridCell.Tab.2.right/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755114439" />
<state width="2517" height="301" key="GridCell.Tab.3.bottom" timestamp="1602755114442">
<state width="2517" height="464" key="GridCell.Tab.2.right/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755691468" />
<state width="2517" height="464" key="GridCell.Tab.3.bottom" timestamp="1602755691472">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="2517" height="301" key="GridCell.Tab.3.bottom/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755114442" />
<state width="2517" height="301" key="GridCell.Tab.3.center" timestamp="1602755114440">
<state width="2517" height="464" key="GridCell.Tab.3.bottom/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755691472" />
<state width="2517" height="464" key="GridCell.Tab.3.center" timestamp="1602755691470">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="2517" height="301" key="GridCell.Tab.3.center/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755114440" />
<state width="2517" height="301" key="GridCell.Tab.3.left" timestamp="1602755114440">
<state width="2517" height="464" key="GridCell.Tab.3.center/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755691470" />
<state width="2517" height="464" key="GridCell.Tab.3.left" timestamp="1602755691469">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="2517" height="301" key="GridCell.Tab.3.left/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755114440" />
<state width="2517" height="301" key="GridCell.Tab.3.right" timestamp="1602755114441">
<state width="2517" height="464" key="GridCell.Tab.3.left/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755691469" />
<state width="2517" height="464" key="GridCell.Tab.3.right" timestamp="1602755691471">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="2517" height="301" key="GridCell.Tab.3.right/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755114441" />
<state width="2517" height="301" key="GridCell.Tab.4.bottom" timestamp="1602755114444">
<state width="2517" height="464" key="GridCell.Tab.3.right/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755691471" />
<state width="2517" height="464" key="GridCell.Tab.4.bottom" timestamp="1602755691475">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="2517" height="301" key="GridCell.Tab.4.bottom/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755114444" />
<state width="2517" height="301" key="GridCell.Tab.4.center" timestamp="1602755114443">
<state width="2517" height="464" key="GridCell.Tab.4.bottom/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755691475" />
<state width="2517" height="464" key="GridCell.Tab.4.center" timestamp="1602755691473">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="2517" height="301" key="GridCell.Tab.4.center/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755114443" />
<state width="2517" height="301" key="GridCell.Tab.4.left" timestamp="1602755114442">
<state width="2517" height="464" key="GridCell.Tab.4.center/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755691473" />
<state width="2517" height="464" key="GridCell.Tab.4.left" timestamp="1602755691472">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="2517" height="301" key="GridCell.Tab.4.left/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755114442" />
<state width="2517" height="301" key="GridCell.Tab.4.right" timestamp="1602755114444">
<state width="2517" height="464" key="GridCell.Tab.4.left/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755691472" />
<state width="2517" height="464" key="GridCell.Tab.4.right" timestamp="1602755691475">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state width="2517" height="301" key="GridCell.Tab.4.right/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755114444" />
<state width="2517" height="464" key="GridCell.Tab.4.right/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755691475" />
<state x="872" y="432" key="Rider.ProjectTemplateDialog.Size" timestamp="1602683469535">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state x="872" y="432" key="Rider.ProjectTemplateDialog.Size/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602683469535" />
<state x="1108" y="385" key="RiderGenerateDialog" timestamp="1602681877222">
<state x="1108" y="385" key="RiderGenerateDialog" timestamp="1602755875981">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state x="1108" y="385" key="RiderGenerateDialog/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602681877222" />
<state x="1108" y="385" key="RiderGenerateDialog/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755875981" />
<state x="1078" y="410" key="RollbackChangesDialog" timestamp="1602585122733">
<screen x="0" y="0" width="2560" height="1400" />
</state>
@ -287,10 +292,10 @@
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state x="92" y="92" width="2376" height="1216" key="VCS.FileHistoryDialog/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602678875251" />
<state x="872" y="433" key="Vcs.Push.Dialog.v2" timestamp="1602687629956">
<state x="872" y="433" key="Vcs.Push.Dialog.v2" timestamp="1602755745888">
<screen x="0" y="0" width="2560" height="1400" />
</state>
<state x="872" y="433" key="Vcs.Push.Dialog.v2/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602687629956" />
<state x="872" y="433" key="Vcs.Push.Dialog.v2/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602755745888" />
<state x="930" y="299" width="700" height="801" key="find.popup" timestamp="1602593714122">
<screen x="0" y="0" width="2560" height="1400" />
</state>

View File

@ -0,0 +1,33 @@
using System;
using EvoCalculator.Core.Models.Calculation.Interfaces;
using EvoCalculator.Core.Models.Calculation.Models.Prepared;
namespace EvoCalculator.Core.Calculation.Columns
{
public class DateTempColumn : IColumn<DateTime>
{
public DateTime[] Values { get; set; }
public DateTempColumn(int count = 67)
{
Values = new DateTime[count];
}
public void ComputeValues(PreparedValues preparedValues, PreparedPayments preparedPayments,
Constants.Calculation constants,
params IColumn<DateTime>[] columns)
{
Values[0] = preparedValues.DogDate;
Values[1] = Values[0];
Values[2] = preparedValues.PaymentDateNew ?? Values[1].AddMonths(1);
for (var i = 3; i < Values.Length; i++)
{
Values[i] = preparedValues.PaymentDateNew == null
? Values[1].AddMonths(i - 1)
: Values[2].AddMonths(i - 2);
}
}
}
}

View File

@ -0,0 +1,194 @@
using System;
using EvoCalculator.Core.Calculation.Columns;
using EvoCalculator.Core.Models.Calculation.Models.Prepared;
using Xunit;
namespace EvoCalculator.Core.Tests.Calculation.Suite.Columns
{
public class DateTempTests
{
[Fact]
public void DateTempTest1()
{
var preparedValues =
new PreparedValues()
{
DogDate = new DateTime(2018, 10, 31),
PaymentDateNew = null,
};
var dateTempColumn = new DateTempColumn();
dateTempColumn.ComputeValues(
preparedValues
, null
, new Constants.Calculation()
, null);
var expected = new DateTime[]
{
new DateTime(2018, 10, 31),
new DateTime(2018, 10, 31),
new DateTime(2018, 11, 30),
new DateTime(2018, 12, 31),
new DateTime(2019, 1, 31),
new DateTime(2019, 2, 28),
new DateTime(2019, 3, 31),
new DateTime(2019, 4, 30),
new DateTime(2019, 5, 31),
new DateTime(2019, 6, 30),
new DateTime(2019, 7, 31),
new DateTime(2019, 8, 31),
new DateTime(2019, 9, 30),
new DateTime(2019, 10, 31),
new DateTime(2019, 11, 30),
new DateTime(2019, 12, 31),
new DateTime(2020, 1, 31),
new DateTime(2020, 2, 29),
new DateTime(2020, 3, 31),
new DateTime(2020, 4, 30),
new DateTime(2020, 5, 31),
new DateTime(2020, 6, 30),
new DateTime(2020, 7, 31),
new DateTime(2020, 8, 31),
new DateTime(2020, 9, 30),
new DateTime(2020, 10, 31),
new DateTime(2020, 11, 30),
new DateTime(2020, 12, 31),
new DateTime(2021, 1, 31),
new DateTime(2021, 2, 28),
new DateTime(2021, 3, 31),
new DateTime(2021, 4, 30),
new DateTime(2021, 5, 31),
new DateTime(2021, 6, 30),
new DateTime(2021, 7, 31),
new DateTime(2021, 8, 31),
new DateTime(2021, 9, 30),
new DateTime(2021, 10, 31),
new DateTime(2021, 11, 30),
new DateTime(2021, 12, 31),
new DateTime(2022, 1, 31),
new DateTime(2022, 2, 28),
new DateTime(2022, 3, 31),
new DateTime(2022, 4, 30),
new DateTime(2022, 5, 31),
new DateTime(2022, 6, 30),
new DateTime(2022, 7, 31),
new DateTime(2022, 8, 31),
new DateTime(2022, 9, 30),
new DateTime(2022, 10, 31),
new DateTime(2022, 11, 30),
new DateTime(2022, 12, 31),
new DateTime(2023, 1, 31),
new DateTime(2023, 2, 28),
new DateTime(2023, 3, 31),
new DateTime(2023, 4, 30),
new DateTime(2023, 5, 31),
new DateTime(2023, 6, 30),
new DateTime(2023, 7, 31),
new DateTime(2023, 8, 31),
new DateTime(2023, 9, 30),
new DateTime(2023, 10, 31),
new DateTime(2023, 11, 30),
new DateTime(2023, 12, 31),
new DateTime(2024, 1, 31),
new DateTime(2024, 2, 29),
new DateTime(2024, 3, 31),
};
var res = dateTempColumn.Values;
Assert.Equal(expected, res);
}
[Fact]
public void DateTempTest2()
{
var preparedValues =
new PreparedValues()
{
DogDate = new DateTime(2018, 10, 31),
PaymentDateNew = new DateTime(2018, 12, 11),
};
var dateTempColumn = new DateTempColumn();
dateTempColumn.ComputeValues(
preparedValues
, null
, new Constants.Calculation()
, null);
var expected = new DateTime[]
{
new DateTime(2018, 10, 31),
new DateTime(2018, 10, 31),
new DateTime(2018, 12, 11),
new DateTime(2019, 1, 11),
new DateTime(2019, 2, 11),
new DateTime(2019, 3, 11),
new DateTime(2019, 4, 11),
new DateTime(2019, 5, 11),
new DateTime(2019, 6, 11),
new DateTime(2019, 7, 11),
new DateTime(2019, 8, 11),
new DateTime(2019, 9, 11),
new DateTime(2019, 10, 11),
new DateTime(2019, 11, 11),
new DateTime(2019, 12, 11),
new DateTime(2020, 1, 11),
new DateTime(2020, 2, 11),
new DateTime(2020, 3, 11),
new DateTime(2020, 4, 11),
new DateTime(2020, 5, 11),
new DateTime(2020, 6, 11),
new DateTime(2020, 7, 11),
new DateTime(2020, 8, 11),
new DateTime(2020, 9, 11),
new DateTime(2020, 10, 11),
new DateTime(2020, 11, 11),
new DateTime(2020, 12, 11),
new DateTime(2021, 1, 11),
new DateTime(2021, 2, 11),
new DateTime(2021, 3, 11),
new DateTime(2021, 4, 11),
new DateTime(2021, 5, 11),
new DateTime(2021, 6, 11),
new DateTime(2021, 7, 11),
new DateTime(2021, 8, 11),
new DateTime(2021, 9, 11),
new DateTime(2021, 10, 11),
new DateTime(2021, 11, 11),
new DateTime(2021, 12, 11),
new DateTime(2022, 1, 11),
new DateTime(2022, 2, 11),
new DateTime(2022, 3, 11),
new DateTime(2022, 4, 11),
new DateTime(2022, 5, 11),
new DateTime(2022, 6, 11),
new DateTime(2022, 7, 11),
new DateTime(2022, 8, 11),
new DateTime(2022, 9, 11),
new DateTime(2022, 10, 11),
new DateTime(2022, 11, 11),
new DateTime(2022, 12, 11),
new DateTime(2023, 1, 11),
new DateTime(2023, 2, 11),
new DateTime(2023, 3, 11),
new DateTime(2023, 4, 11),
new DateTime(2023, 5, 11),
new DateTime(2023, 6, 11),
new DateTime(2023, 7, 11),
new DateTime(2023, 8, 11),
new DateTime(2023, 9, 11),
new DateTime(2023, 10, 11),
new DateTime(2023, 11, 11),
new DateTime(2023, 12, 11),
new DateTime(2024, 1, 11),
new DateTime(2024, 2, 11),
new DateTime(2024, 3, 11),
new DateTime(2024, 4, 11),
};
var res = dateTempColumn.Values;
Assert.Equal(expected, res);
}
}
}