more columns && comparer
This commit is contained in:
parent
affe9fdded
commit
cf8aa960d8
@ -11,6 +11,7 @@
|
||||
<e p="C:\Users\Chika\.nuget\packages\xunit.runner.visualstudio\2.4.0\build\netcoreapp1.0\xunit.runner.visualstudio.dotnetcore.testadapter.dll" t="Include" />
|
||||
<e p="C:\Users\Chika\AppData\Local\JetBrains\Rider2020.2\extResources" t="IncludeRecursive" />
|
||||
<e p="C:\Users\Chika\AppData\Local\JetBrains\Rider2020.2\resharper-host\Local\Transient\Rider\v202\SolutionCaches\_EvoCalculator.Core.1747351465.00" t="ExcludeRecursive" />
|
||||
<e p="C:\Users\Chika\AppData\Roaming\JetBrains\Rider2020.2\scratches" t="IncludeRecursive" />
|
||||
<e p="C:\Users\Chika\Projects\EvoCalculator.Core" t="IncludeFlat">
|
||||
<e p="EvoCalculator.Core" t="IncludeRecursive">
|
||||
<e p="appsettings.Development.json" t="Include" />
|
||||
@ -38,12 +39,20 @@
|
||||
<e p="EvoCalculator.Core.Calculation" t="IncludeRecursive">
|
||||
<e p="bin" t="ExcludeRecursive" />
|
||||
<e p="Columns" t="Include">
|
||||
<e p="AcceptInsuranceColumn.cs" t="Include" />
|
||||
<e p="AcceptKaskoColumn.cs" t="Include" />
|
||||
<e p="AcceptOsagoColumn.cs" t="Include" />
|
||||
<e p="AcceptSumColumn.cs" t="Include" />
|
||||
<e p="BaseColumn.cs" t="Include" />
|
||||
<e p="BaseColumnWithXIRR.cs" t="Include" />
|
||||
<e p="DateColumn.cs" t="Include" />
|
||||
<e p="DateTempColumn.cs" t="Include" />
|
||||
<e p="DeprecationColumn.cs" t="Include" />
|
||||
<e p="DeprecationLDColumn.cs" t="Include" />
|
||||
<e p="DeprecationLPColumn.cs" t="Include" />
|
||||
<e p="GPS_GrColumn.cs" t="Include" />
|
||||
<e p="KaskoNmperGrColumn.cs" t="Include" />
|
||||
<e p="NPVBonusExpensesColumn.cs" t="Include" />
|
||||
<e p="PercentPaymentColumn.cs" t="Include" />
|
||||
<e p="SumColumn.cs" t="Include" />
|
||||
<e p="SumWithVATColumn.cs" t="Include" />
|
||||
@ -73,9 +82,7 @@
|
||||
</e>
|
||||
<e p="EvoCalculator.Core.FinanceFormulas" t="IncludeRecursive">
|
||||
<e p="bin" t="ExcludeRecursive" />
|
||||
<e p="Bisection.cs" t="Include" />
|
||||
<e p="EvoCalculator.Core.FinanceFormulas.csproj" t="IncludeRecursive" />
|
||||
<e p="GoalXIRR.cs" t="Include" />
|
||||
<e p="obj" t="ExcludeRecursive">
|
||||
<e p="Debug" t="Include">
|
||||
<e p="netcoreapp3.1" t="Include">
|
||||
@ -122,10 +129,18 @@
|
||||
<e p="bin" t="ExcludeRecursive" />
|
||||
<e p="Calculation" t="Include">
|
||||
<e p="Columns" t="Include">
|
||||
<e p="AcceptInsuranceTests.cs" t="Include" />
|
||||
<e p="AcceptKaskoTests.cs" t="Include" />
|
||||
<e p="AcceptOsagoTests.cs" t="Include" />
|
||||
<e p="AcceptSumTests.cs" t="Include" />
|
||||
<e p="DateColumnTests.cs" t="Include" />
|
||||
<e p="DateTempTests.cs" t="Include" />
|
||||
<e p="DeprecationLDTests.cs" t="Include" />
|
||||
<e p="DeprecationLPTests.cs" t="Include" />
|
||||
<e p="DeprecationTests.cs" t="Include" />
|
||||
<e p="GPS_GrTests.cs" t="Include" />
|
||||
<e p="KaskoNmperGrTests.cs" t="Include" />
|
||||
<e p="NPVBonusExpensesTests.cs" t="Include" />
|
||||
<e p="PercentPaymentTests.cs" t="Include" />
|
||||
<e p="SumColumnTest.cs" t="Include" />
|
||||
<e p="SumWithVatTests.cs" t="Include" />
|
||||
@ -137,6 +152,7 @@
|
||||
<e p="FinanceFormulasTests.cs" t="Include" />
|
||||
</e>
|
||||
</e>
|
||||
<e p="DoubleArrayComparer.cs" t="Include" />
|
||||
<e p="EvoCalculator.Core.Tests.csproj" t="IncludeRecursive" />
|
||||
<e p="obj" t="ExcludeRecursive">
|
||||
<e p="Debug" t="Include">
|
||||
|
||||
204
.idea/.idea.EvoCalculator.Core/.idea/workspace.xml
generated
204
.idea/.idea.EvoCalculator.Core/.idea/workspace.xml
generated
@ -14,9 +14,28 @@
|
||||
</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/AcceptInsuranceColumn.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/AcceptKaskoColumn.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/AcceptOsagoColumn.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/AcceptSumColumn.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/DeprecationColumn.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/DeprecationLDColumn.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/DeprecationLPColumn.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/NPVBonusExpensesColumn.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/AcceptInsuranceTests.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/AcceptKaskoTests.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/AcceptOsagoTests.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/AcceptSumTests.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/DeprecationLDTests.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/DeprecationLPTests.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/DeprecationTests.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/NPVBonusExpensesTests.cs" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/EvoCalculator.Core.Tests/DoubleArrayComparer.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/BaseColumnWithXIRR.cs" beforeDir="false" afterPath="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/BaseColumnWithXIRR.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/SumColumn.cs" beforeDir="false" afterPath="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/SumColumn.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/EvoCalculator.Core.FinanceFormulas/Bisection.cs" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/EvoCalculator.Core.FinanceFormulas/GoalXIRR.cs" beforeDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/EvoCalculator.Core.Models/Calculation/Models/Prepared/PreparedParams.cs" beforeDir="false" afterPath="$PROJECT_DIR$/EvoCalculator.Core.Models/Calculation/Models/Prepared/PreparedParams.cs" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/SumColumnTest.cs" beforeDir="false" afterPath="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/SumColumnTest.cs" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
@ -28,63 +47,23 @@
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="HighlightingSettingsPerFile">
|
||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/SourcesCache/AD61CA47-F8B7-4CC6-93A0-BA44CC73B5C7/72/Double.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock://C:/Users/Chika/Projects/EvoCalculator.Core/EvoCalculator.Core.FinanceFormulas/XIRR.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/E2E1F770-6781-48FC-97C9-82BA075D5898/89/f5bc57e5/Trident.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$PROJECT_DIR$/EvoCalculator.Core.FinanceFormulas/XIRR.cs" root0="FORCE_HIGHLIGHTING" />
|
||||
<setting file="mock://C:/Users/Chika/Projects/EvoCalculator.Core/EvoCalculator.Core.Calculation/Columns/KaskoNmperGrColumn.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/E2E1F770-6781-48FC-97C9-82BA075D5898/af/6846d1ce/GoalSeek.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///Dummy.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/9152434B-0FAC-463B-87F2-DD9AF798817F/2e/201d3c41/Assert.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/E2E1F770-6781-48FC-97C9-82BA075D5898/8a/efc30f2b/IGoalSeekAlgorithm.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/SourcesCache/AD61CA47-F8B7-4CC6-93A0-BA44CC73B5C7/72/Double.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/SourcesCache/AD61CA47-F8B7-4CC6-93A0-BA44CC73B5C7/49/DateTime.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<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="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/E2E1F770-6781-48FC-97C9-82BA075D5898/92/f4ccca9d/GoalSeekResult.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock://C:/Users/Chika/Projects/EvoCalculator.Core/EvoCalculator.Core.Calculation/Columns/KaskoNmperGrColumn.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///Dummy.cs" root0="SKIP_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="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/E2E1F770-6781-48FC-97C9-82BA075D5898/d6/c014ca2d/GoalSeekOptions.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/DecompilerCache/decompiler/E2E1F770-6781-48FC-97C9-82BA075D5898/89/f5bc57e5/Trident.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="file://$APPLICATION_CONFIG_DIR$/resharper-host/SourcesCache/31F94AF4-0455-4C4C-BD4F-AB58A9F2D1BF/2C/Sum.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
<setting file="mock:///Dummy.cs" root0="SKIP_HIGHLIGHTING" />
|
||||
</component>
|
||||
<component name="IdeDocumentHistory">
|
||||
<option name="CHANGED_PATHS">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Models/Calculation/Models/Prepared/PreparedParams.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Constants.cs" />
|
||||
<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.Tests/Calculation/Suite/ColumnsTests.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Models/Calculation/Models/Prepared/PreparedPayments.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/KaskoNmperGr.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Models/Calculation/Interfaces/IColumn.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Models/Calculation/Interfaces/BaseColumnWithXIRR.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.FinanceFormulas/Class1.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.FinanceFormulas/XNPV.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.FinanceFormulas/XIRR.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.FinanceFormulas/XNPV.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Models/Calculation/Models/BaseColumnWithXIRR.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.FinanceFormulas/Bisection.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.FinanceFormulas/GoalSeek.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Suite/FinanceFormulasTests.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Models/Calculation/Interfaces/IColumnWithXIRR.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/TLM_GR.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/TLM_GRColumn.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Suite/Columns/SumColumnTests.cs" />
|
||||
@ -115,8 +94,27 @@
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/FinanceFormulas/FinanceFormulasTests.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/BaseColumnWithXIRR.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.FinanceFormulas/XIRR.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/SumColumnTest.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/SumColumn.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/AcceptSumColumn.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/AcceptSumTests.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/AcceptKaskoColumn.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/AcceptOsagoColumn.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/AcceptKaskoTests.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/AcceptOsagoTests.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/AcceptInsuranceColumn.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/AcceptInsuranceTests.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/DeprecationLPColumn.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Tests/DoubleArrayComparer.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/DeprecationLPColumnTests.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Models/Calculation/Models/Prepared/PreparedParams.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/DeprecationLDColumn.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/DeprecationLPTests.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/DeprecationLDTests.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/SumColumnTest.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/DeprecationColumn.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/DeprecationTests.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Calculation/Columns/NPVBonusExpensesColumn.cs" />
|
||||
<option value="$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/NPVBonusExpensesTests.cs" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
@ -185,7 +183,8 @@
|
||||
<workItem from="1602754684591" duration="13639000" />
|
||||
<workItem from="1602850022326" duration="4617000" />
|
||||
<workItem from="1602854690202" duration="5777000" />
|
||||
<workItem from="1603096869934" duration="28356000" />
|
||||
<workItem from="1603096869934" duration="28730000" />
|
||||
<workItem from="1603193984674" duration="8173000" />
|
||||
</task>
|
||||
<task id="LOCAL-00001" summary="rename: flow">
|
||||
<created>1602593830686</created>
|
||||
@ -237,94 +236,94 @@
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="897" height="464" key="DebuggerActiveHint/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603130767865" />
|
||||
<state width="2517" height="512" key="GridCell.Tab.0.bottom" timestamp="1603133451274">
|
||||
<state width="2517" height="371" key="GridCell.Tab.0.bottom" timestamp="1603198290510">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="2517" height="512" key="GridCell.Tab.0.bottom/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603133451274" />
|
||||
<state width="2517" height="512" key="GridCell.Tab.0.center" timestamp="1603133451274">
|
||||
<state width="2517" height="371" key="GridCell.Tab.0.bottom/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198290510" />
|
||||
<state width="2517" height="371" key="GridCell.Tab.0.center" timestamp="1603198290509">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="2517" height="512" key="GridCell.Tab.0.center/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603133451274" />
|
||||
<state width="2517" height="512" key="GridCell.Tab.0.left" timestamp="1603133451273">
|
||||
<state width="2517" height="371" key="GridCell.Tab.0.center/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198290509" />
|
||||
<state width="2517" height="371" key="GridCell.Tab.0.left" timestamp="1603198290509">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="2517" height="512" key="GridCell.Tab.0.left/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603133451273" />
|
||||
<state width="2517" height="512" key="GridCell.Tab.0.right" timestamp="1603133451274">
|
||||
<state width="2517" height="371" key="GridCell.Tab.0.left/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198290509" />
|
||||
<state width="2517" height="371" key="GridCell.Tab.0.right" timestamp="1603198290510">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="2517" height="512" key="GridCell.Tab.0.right/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603133451274" />
|
||||
<state width="2517" height="512" key="GridCell.Tab.1.bottom" timestamp="1603133451274">
|
||||
<state width="2517" height="371" key="GridCell.Tab.0.right/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198290510" />
|
||||
<state width="2517" height="371" key="GridCell.Tab.1.bottom" timestamp="1603198290512">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="2517" height="512" key="GridCell.Tab.1.bottom/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603133451274" />
|
||||
<state width="2517" height="512" key="GridCell.Tab.1.center" timestamp="1603133451274">
|
||||
<state width="2517" height="371" key="GridCell.Tab.1.bottom/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198290512" />
|
||||
<state width="2517" height="371" key="GridCell.Tab.1.center" timestamp="1603198290511">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="2517" height="512" key="GridCell.Tab.1.center/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603133451274" />
|
||||
<state width="2517" height="512" key="GridCell.Tab.1.left" timestamp="1603133451274">
|
||||
<state width="2517" height="371" key="GridCell.Tab.1.center/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198290511" />
|
||||
<state width="2517" height="371" key="GridCell.Tab.1.left" timestamp="1603198290511">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="2517" height="512" key="GridCell.Tab.1.left/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603133451274" />
|
||||
<state width="2517" height="512" key="GridCell.Tab.1.right" timestamp="1603133451274">
|
||||
<state width="2517" height="371" key="GridCell.Tab.1.left/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198290511" />
|
||||
<state width="2517" height="371" key="GridCell.Tab.1.right" timestamp="1603198290512">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="2517" height="512" key="GridCell.Tab.1.right/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603133451274" />
|
||||
<state width="2517" height="512" key="GridCell.Tab.2.bottom" timestamp="1603133451274">
|
||||
<state width="2517" height="371" key="GridCell.Tab.1.right/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198290512" />
|
||||
<state width="2517" height="371" key="GridCell.Tab.2.bottom" timestamp="1603198290513">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="2517" height="512" key="GridCell.Tab.2.bottom/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603133451274" />
|
||||
<state width="2517" height="512" key="GridCell.Tab.2.center" timestamp="1603133451274">
|
||||
<state width="2517" height="371" key="GridCell.Tab.2.bottom/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198290513" />
|
||||
<state width="2517" height="371" key="GridCell.Tab.2.center" timestamp="1603198290513">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="2517" height="512" key="GridCell.Tab.2.center/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603133451274" />
|
||||
<state width="2517" height="512" key="GridCell.Tab.2.left" timestamp="1603133451274">
|
||||
<state width="2517" height="371" key="GridCell.Tab.2.center/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198290513" />
|
||||
<state width="2517" height="371" key="GridCell.Tab.2.left" timestamp="1603198290513">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="2517" height="512" key="GridCell.Tab.2.left/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603133451274" />
|
||||
<state width="2517" height="512" key="GridCell.Tab.2.right" timestamp="1603133451274">
|
||||
<state width="2517" height="371" key="GridCell.Tab.2.left/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198290513" />
|
||||
<state width="2517" height="371" key="GridCell.Tab.2.right" timestamp="1603198290513">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="2517" height="512" key="GridCell.Tab.2.right/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603133451274" />
|
||||
<state width="2517" height="512" key="GridCell.Tab.3.bottom" timestamp="1603133451274">
|
||||
<state width="2517" height="371" key="GridCell.Tab.2.right/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198290513" />
|
||||
<state width="2517" height="371" key="GridCell.Tab.3.bottom" timestamp="1603198290514">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="2517" height="512" key="GridCell.Tab.3.bottom/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603133451274" />
|
||||
<state width="2517" height="512" key="GridCell.Tab.3.center" timestamp="1603133451274">
|
||||
<state width="2517" height="371" key="GridCell.Tab.3.bottom/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198290514" />
|
||||
<state width="2517" height="371" key="GridCell.Tab.3.center" timestamp="1603198290514">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="2517" height="512" key="GridCell.Tab.3.center/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603133451274" />
|
||||
<state width="2517" height="512" key="GridCell.Tab.3.left" timestamp="1603133451274">
|
||||
<state width="2517" height="371" key="GridCell.Tab.3.center/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198290514" />
|
||||
<state width="2517" height="371" key="GridCell.Tab.3.left" timestamp="1603198290514">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="2517" height="512" key="GridCell.Tab.3.left/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603133451274" />
|
||||
<state width="2517" height="512" key="GridCell.Tab.3.right" timestamp="1603133451274">
|
||||
<state width="2517" height="371" key="GridCell.Tab.3.left/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198290514" />
|
||||
<state width="2517" height="371" key="GridCell.Tab.3.right" timestamp="1603198290514">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="2517" height="512" key="GridCell.Tab.3.right/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603133451274" />
|
||||
<state width="2517" height="512" key="GridCell.Tab.4.bottom" timestamp="1603133451275">
|
||||
<state width="2517" height="371" key="GridCell.Tab.3.right/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198290514" />
|
||||
<state width="2517" height="371" key="GridCell.Tab.4.bottom" timestamp="1603198290515">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="2517" height="512" key="GridCell.Tab.4.bottom/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603133451275" />
|
||||
<state width="2517" height="512" key="GridCell.Tab.4.center" timestamp="1603133451274">
|
||||
<state width="2517" height="371" key="GridCell.Tab.4.bottom/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198290515" />
|
||||
<state width="2517" height="371" key="GridCell.Tab.4.center" timestamp="1603198290515">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="2517" height="512" key="GridCell.Tab.4.center/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603133451274" />
|
||||
<state width="2517" height="512" key="GridCell.Tab.4.left" timestamp="1603133451274">
|
||||
<state width="2517" height="371" key="GridCell.Tab.4.center/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198290515" />
|
||||
<state width="2517" height="371" key="GridCell.Tab.4.left" timestamp="1603198290514">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="2517" height="512" key="GridCell.Tab.4.left/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603133451274" />
|
||||
<state width="2517" height="512" key="GridCell.Tab.4.right" timestamp="1603133451275">
|
||||
<state width="2517" height="371" key="GridCell.Tab.4.left/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198290514" />
|
||||
<state width="2517" height="371" key="GridCell.Tab.4.right" timestamp="1603198290515">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state width="2517" height="512" key="GridCell.Tab.4.right/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603133451275" />
|
||||
<state width="2517" height="371" key="GridCell.Tab.4.right/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198290515" />
|
||||
<state x="872" y="432" key="Rider.ProjectTemplateDialog.Size" timestamp="1602854431119">
|
||||
<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="1602854431119" />
|
||||
<state x="1108" y="385" key="RiderGenerateDialog" timestamp="1602853905402">
|
||||
<state x="1108" y="385" key="RiderGenerateDialog" timestamp="1603197820087">
|
||||
<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="1602853905402" />
|
||||
<state x="1108" y="385" key="RiderGenerateDialog/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603197820087" />
|
||||
<state x="1078" y="410" key="RollbackChangesDialog" timestamp="1603131092253">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
@ -345,37 +344,20 @@
|
||||
<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="1602755745888" />
|
||||
<state x="898" y="0" width="1161" height="1387" key="dock-window-1" timestamp="1602760039715">
|
||||
<state x="898" y="0" width="1161" height="1387" key="dock-window-1" timestamp="1603198596935">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state x="898" y="0" width="1161" height="1387" key="dock-window-1/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602760039715" />
|
||||
<state x="930" y="299" width="730" height="801" key="find.popup" timestamp="1603129257494">
|
||||
<state x="898" y="0" width="1161" height="1387" key="dock-window-1/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603198596935" />
|
||||
<state x="930" y="299" width="730" height="801" key="find.popup" timestamp="1603199842938">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state x="930" y="299" width="730" height="801" key="find.popup/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603129257494" />
|
||||
<state x="943" y="315" width="672" height="678" key="search.everywhere.popup" timestamp="1602850027763">
|
||||
<state x="930" y="299" width="730" height="801" key="find.popup/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603199842938" />
|
||||
<state x="943" y="315" width="672" height="678" key="search.everywhere.popup" timestamp="1603195763131">
|
||||
<screen x="0" y="0" width="2560" height="1400" />
|
||||
</state>
|
||||
<state x="943" y="315" width="672" height="678" key="search.everywhere.popup/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1602850027763" />
|
||||
<state x="943" y="315" width="672" height="678" key="search.everywhere.popup/0.0.2560.1400/2560.0.1920.1040@0.0.2560.1400" timestamp="1603195763131" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
<breakpoints>
|
||||
<line-breakpoint enabled="true" type="DotNet Breakpoints">
|
||||
<url>file://$PROJECT_DIR$/EvoCalculator.Core.Tests/Calculation/Columns/SumColumnTest.cs</url>
|
||||
<line>308</line>
|
||||
<properties documentPath="C:\Users\Chika\Projects\EvoCalculator.Core\EvoCalculator.Core.Tests\Calculation\Columns\SumColumnTest.cs" initialLine="308">
|
||||
<startOffsets>
|
||||
<option value="11212" />
|
||||
</startOffsets>
|
||||
<endOffsets>
|
||||
<option value="11243" />
|
||||
</endOffsets>
|
||||
</properties>
|
||||
<option name="timeStamp" value="36" />
|
||||
</line-breakpoint>
|
||||
</breakpoints>
|
||||
</breakpoint-manager>
|
||||
<pin-to-top-manager>
|
||||
<pinned-members>
|
||||
<PinnedItemInfo parentTag="Frame#EvoCalculator.Core.Tests.Calculation.Suite.Columns.TLM_GrTests.TLM_GrTest1" memberName="expected" />
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace EvoCalculator.Core.Calculation.Columns
|
||||
{
|
||||
public class AcceptInsuranceColumn : BaseColumn<double>
|
||||
{
|
||||
public AcceptInsuranceColumn(int count) : base(count)
|
||||
{
|
||||
}
|
||||
|
||||
public void ComputeValues(AcceptKaskoColumn acceptKaskoColumn, AcceptOsagoColumn acceptOsagoColumn)
|
||||
{
|
||||
for (var i = 1; i < Values.Length; i++)
|
||||
{
|
||||
Values[i] = acceptKaskoColumn.Values[i] + acceptOsagoColumn.Values[i];
|
||||
}
|
||||
|
||||
Values[0] = Values.Skip(1).Sum(x => x);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
EvoCalculator.Core.Calculation/Columns/AcceptKaskoColumn.cs
Normal file
22
EvoCalculator.Core.Calculation/Columns/AcceptKaskoColumn.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System.Linq;
|
||||
using EvoCalculator.Core.Models.Calculation.Models.Prepared;
|
||||
|
||||
namespace EvoCalculator.Core.Calculation.Columns
|
||||
{
|
||||
public class AcceptKaskoColumn : BaseColumn<double>
|
||||
{
|
||||
public AcceptKaskoColumn(int count) : base(count)
|
||||
{
|
||||
}
|
||||
|
||||
public void ComputeValues(PreparedValues preparedValues)
|
||||
{
|
||||
Values[1] = 0;
|
||||
for (var i = 2; i < Values.Length; i++)
|
||||
{
|
||||
Values[i] = preparedValues.InsuranceKaskoNmper / (preparedValues.Nmper - 1);
|
||||
}
|
||||
Values[0] = Values.Skip(1).Sum(x => x);
|
||||
}
|
||||
}
|
||||
}
|
||||
22
EvoCalculator.Core.Calculation/Columns/AcceptOsagoColumn.cs
Normal file
22
EvoCalculator.Core.Calculation/Columns/AcceptOsagoColumn.cs
Normal file
@ -0,0 +1,22 @@
|
||||
using System.Linq;
|
||||
using EvoCalculator.Core.Models.Calculation.Models.Prepared;
|
||||
|
||||
namespace EvoCalculator.Core.Calculation.Columns
|
||||
{
|
||||
public class AcceptOsagoColumn : BaseColumn<double>
|
||||
{
|
||||
public AcceptOsagoColumn(int count) : base(count)
|
||||
{
|
||||
}
|
||||
|
||||
public void ComputeValues(PreparedValues preparedValues)
|
||||
{
|
||||
for (var i = 0; i < Values.Length; i++)
|
||||
{
|
||||
Values[i] = i > 1 && i <= 12 ? preparedValues.InsuranceOsago / 11 : 0;
|
||||
}
|
||||
|
||||
Values[0] = Values.Sum(x => x);
|
||||
}
|
||||
}
|
||||
}
|
||||
27
EvoCalculator.Core.Calculation/Columns/AcceptSumColumn.cs
Normal file
27
EvoCalculator.Core.Calculation/Columns/AcceptSumColumn.cs
Normal file
@ -0,0 +1,27 @@
|
||||
using System.Linq;
|
||||
using EvoCalculator.Core.Models.Calculation.Models.Prepared;
|
||||
|
||||
namespace EvoCalculator.Core.Calculation.Columns
|
||||
{
|
||||
public class AcceptSumColumn : BaseColumn<double>
|
||||
{
|
||||
public AcceptSumColumn(int count) : base(count)
|
||||
{
|
||||
}
|
||||
|
||||
public void ComputeValues(
|
||||
PreparedValues preparedValues
|
||||
, SumColumn sumColumn
|
||||
, VATColumn vatColumn
|
||||
, SumWithVATColumn sumWithVatColumn)
|
||||
{
|
||||
for (var i = 1; i < Values.Length; i++)
|
||||
{
|
||||
Values[i] = preparedValues.AcceptSum * sumColumn.Values[i] /
|
||||
(sumWithVatColumn.Values[0] - vatColumn.Values[0]);
|
||||
}
|
||||
|
||||
Values[0] = Values.Sum(x => x);
|
||||
}
|
||||
}
|
||||
}
|
||||
23
EvoCalculator.Core.Calculation/Columns/DeprecationColumn.cs
Normal file
23
EvoCalculator.Core.Calculation/Columns/DeprecationColumn.cs
Normal file
@ -0,0 +1,23 @@
|
||||
using System.Linq;
|
||||
|
||||
namespace EvoCalculator.Core.Calculation.Columns
|
||||
{
|
||||
public class DeprecationColumn : BaseColumn<double>
|
||||
{
|
||||
public DeprecationColumn(int count) : base(count)
|
||||
{
|
||||
}
|
||||
|
||||
public void ComputeValues(DeprecationLPColumn deprecationLpColumn, DeprecationLDColumn deprecationLdColumn)
|
||||
{
|
||||
for (var i = 1; i < Values.Length; i++)
|
||||
{
|
||||
Values[i] = i < deprecationLpColumn.Values.Length
|
||||
? deprecationLpColumn.Values[i] + deprecationLdColumn.Values[i]
|
||||
: 0 + deprecationLdColumn.Values[i];
|
||||
}
|
||||
|
||||
Values[0] = Values.Skip(1).Sum(x => x);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
using System.Linq;
|
||||
using EvoCalculator.Core.Models.Calculation.Models.Prepared;
|
||||
|
||||
namespace EvoCalculator.Core.Calculation.Columns
|
||||
{
|
||||
public class DeprecationLDColumn : BaseColumn<double>
|
||||
{
|
||||
public DeprecationLDColumn(int count) : base(count)
|
||||
{
|
||||
}
|
||||
|
||||
public void ComputeValues(PreparedValues preparedValues)
|
||||
{
|
||||
Values[1] = 0;
|
||||
for (var i = 2; i < Values.Length - 1; i++)
|
||||
{
|
||||
Values[i] = preparedValues.BalanceHolder == 100000001
|
||||
? preparedValues.DeprecationTime *
|
||||
(preparedValues.AcceptSum - Values.Skip(2).Take(i - 1).Sum(x => x)) / 100
|
||||
: 0;
|
||||
}
|
||||
|
||||
Values[^1] = preparedValues.BalanceHolder == 100000001
|
||||
? preparedValues.AcceptSum - Values.Skip(2)
|
||||
.Take(Values.Length - 1)
|
||||
.Sum(x => x)
|
||||
: 0;
|
||||
|
||||
Values[0] = Values.Skip(1).Sum(x => x);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
using System.Linq;
|
||||
using EvoCalculator.Core.Models.Calculation.Models.Prepared;
|
||||
|
||||
namespace EvoCalculator.Core.Calculation.Columns
|
||||
{
|
||||
public class DeprecationLPColumn : BaseColumn<double>
|
||||
{
|
||||
public DeprecationLPColumn(int count) : base(count)
|
||||
{
|
||||
}
|
||||
|
||||
public void ComputeValues(PreparedValues preparedValues, AcceptSumColumn acceptSumColumn)
|
||||
{
|
||||
for (var i = 1; i < Values.Length; i++)
|
||||
{
|
||||
Values[i] = preparedValues.BalanceHolder == 100000000 ? acceptSumColumn.Values[i] : 0;
|
||||
}
|
||||
|
||||
Values[0] = Values.Skip(1).Sum(x => x);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
using System.Linq;
|
||||
using EvoCalculator.Core.Models.Calculation.Models.Prepared;
|
||||
|
||||
namespace EvoCalculator.Core.Calculation.Columns
|
||||
{
|
||||
public class NPVBonusExpensesColumn : BaseColumn<double>
|
||||
{
|
||||
public NPVBonusExpensesColumn(int count) : base(count)
|
||||
{
|
||||
}
|
||||
|
||||
public void ComputeValues(PreparedValues preparedValues)
|
||||
{
|
||||
Values[1] = -1 * (preparedValues.RatBonus + preparedValues.NsBonus + preparedValues.NsibBonus) *
|
||||
(1 + preparedValues.SalaryRate) *
|
||||
(1 + preparedValues.MarketRate + preparedValues.DistrictRate);
|
||||
|
||||
Values[2] = preparedValues.BonusFix > 0
|
||||
? -preparedValues.BonusFix
|
||||
: -1 * preparedValues.BonusBase * preparedValues.Bonus * (1 + preparedValues.SalaryRate) *
|
||||
(1 + preparedValues.MarketRate + preparedValues.DistrictRate);
|
||||
|
||||
|
||||
for (var i = 3; i < Values.Length; i++)
|
||||
{
|
||||
Values[i] = 0;
|
||||
}
|
||||
|
||||
Values[0] = Values.Skip(1).Sum(x => x);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,295 +0,0 @@
|
||||
// using System;
|
||||
// using System.Linq;
|
||||
// using Money = System.Decimal;
|
||||
// using Rate = System.Double;
|
||||
// using System.Collections.Generic;
|
||||
//
|
||||
// public
|
||||
// struct Pair<T, Z>
|
||||
// {
|
||||
// public Pair(T first, Z second)
|
||||
// {
|
||||
// First = first;
|
||||
// Second = second;
|
||||
// }
|
||||
//
|
||||
// public readonly T First;
|
||||
//
|
||||
// public readonly Z Second;
|
||||
// }
|
||||
//
|
||||
//
|
||||
// public class CashFlow
|
||||
// {
|
||||
// public CashFlow(Money amount, DateTime date)
|
||||
// {
|
||||
// Amount = amount;
|
||||
// Date = date;
|
||||
// }
|
||||
//
|
||||
// public readonly Money Amount;
|
||||
// public readonly DateTime Date;
|
||||
// }
|
||||
//
|
||||
// public struct AlgorithmResult<TKindOfResult, TValue>
|
||||
// {
|
||||
// public AlgorithmResult(TKindOfResult kind, TValue value)
|
||||
// {
|
||||
// Kind = kind;
|
||||
// Value = value;
|
||||
// }
|
||||
//
|
||||
// public readonly TKindOfResult Kind;
|
||||
// public readonly TValue Value;
|
||||
// }
|
||||
//
|
||||
// public enum ApproximateResultKind
|
||||
// {
|
||||
// ApproximateSolution,
|
||||
// ExactSolution,
|
||||
// NoSolutionWithinTolerance
|
||||
// }
|
||||
//
|
||||
// public static class Algorithms
|
||||
// {
|
||||
// internal static Money CalculateXNPV(IEnumerable<CashFlow> cfs, Rate r)
|
||||
// {
|
||||
// if (r <= -1)
|
||||
// r = -0.99999999; // Very funky ... Better check what an IRR <= -100% means
|
||||
//
|
||||
// return (from cf in cfs
|
||||
// let startDate = cfs.OrderBy(cf1 => cf1.Date).First().Date
|
||||
// select cf.Amount / (decimal) Math.Pow(1 + r, (cf.Date - startDate).Days / 365.0)).Sum();
|
||||
// }
|
||||
//
|
||||
// internal static Pair<Rate, Rate> FindBrackets(Func<IEnumerable<CashFlow>, Rate, Money> func,
|
||||
// IEnumerable<CashFlow> cfs)
|
||||
// {
|
||||
// // Abracadabra magic numbers ...
|
||||
// const int maxIter = 100;
|
||||
// const Rate bracketStep = 0.5;
|
||||
// const Rate guess = 0.1;
|
||||
//
|
||||
// Rate leftBracket = guess - bracketStep;
|
||||
// Rate rightBracket = guess + bracketStep;
|
||||
// var iter = 0;
|
||||
//
|
||||
// while (func(cfs, leftBracket) * func(cfs, rightBracket) > 0 && iter++ < maxIter)
|
||||
// {
|
||||
// leftBracket -= bracketStep;
|
||||
// rightBracket += bracketStep;
|
||||
// }
|
||||
//
|
||||
// if (iter >= maxIter)
|
||||
// return new Pair<double, double>(0, 0);
|
||||
//
|
||||
// return new Pair<Rate, Rate>(leftBracket, rightBracket);
|
||||
// }
|
||||
//
|
||||
// // From "Applied Numerical Analyis" by Gerald
|
||||
// internal static AlgorithmResult<ApproximateResultKind, Rate> Bisection(Func<Rate, Money> func,
|
||||
// Pair<Rate, Rate> brackets, Rate tol, int maxIters)
|
||||
// {
|
||||
// int iter = 1;
|
||||
//
|
||||
// Money f3 = 0;
|
||||
// Rate x3 = 0;
|
||||
// Rate x1 = brackets.First;
|
||||
// Rate x2 = brackets.Second;
|
||||
//
|
||||
// do
|
||||
// {
|
||||
// var f1 = func(x1);
|
||||
// var f2 = func(x2);
|
||||
//
|
||||
// if (f1 == 0 && f2 == 0)
|
||||
// return new AlgorithmResult<ApproximateResultKind, Rate>(ApproximateResultKind.NoSolutionWithinTolerance,
|
||||
// x1);
|
||||
//
|
||||
// if (f1 * f2 > 0)
|
||||
// throw new ArgumentException("x1 x2 values don't bracket a root");
|
||||
//
|
||||
// x3 = (x1 + x2) / 2;
|
||||
// f3 = func(x3);
|
||||
//
|
||||
// if (f3 * f1 < 0)
|
||||
// x2 = x3;
|
||||
// else
|
||||
// x1 = x3;
|
||||
//
|
||||
// iter++;
|
||||
// } while (Math.Abs(x1 - x2) / 2 > tol && f3 != 0 && iter < maxIters);
|
||||
//
|
||||
// if (f3 == 0)
|
||||
// return new AlgorithmResult<ApproximateResultKind, Rate>(ApproximateResultKind.ExactSolution, x3);
|
||||
//
|
||||
// if (Math.Abs(x1 - x2) / 2 < tol)
|
||||
// return new AlgorithmResult<ApproximateResultKind, Rate>(ApproximateResultKind.ApproximateSolution, x3);
|
||||
//
|
||||
// if (iter > maxIters)
|
||||
// return new AlgorithmResult<ApproximateResultKind, Rate>(ApproximateResultKind.NoSolutionWithinTolerance,
|
||||
// x3);
|
||||
//
|
||||
// throw new Exception("It should never get here");
|
||||
// }
|
||||
//
|
||||
// public static AlgorithmResult<ApproximateResultKind, Rate> CalculateXIRR(IEnumerable<CashFlow> cfs, Rate tolerance,
|
||||
// int maxIters)
|
||||
// {
|
||||
// var brackets = FindBrackets(CalculateXNPV, cfs);
|
||||
//
|
||||
// if (brackets.First == brackets.Second)
|
||||
// return new AlgorithmResult<ApproximateResultKind, double>(ApproximateResultKind.NoSolutionWithinTolerance,
|
||||
// brackets.First);
|
||||
//
|
||||
// return Bisection(r => CalculateXNPV(cfs, r), brackets, tolerance, maxIters);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // TESTS
|
||||
// using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
// using System.Collections.Generic;
|
||||
// using System;
|
||||
// using Rate = System.Double;
|
||||
//
|
||||
// namespace TimeLineTest
|
||||
// {
|
||||
// [TestClass()]
|
||||
// public class AlgorithmsTest
|
||||
// {
|
||||
// IEnumerable<CashFlow> cfs = new CashFlow[]
|
||||
// {
|
||||
// new CashFlow(-10000, new DateTime(2008, 1, 1)),
|
||||
// new CashFlow(2750, new DateTime(2008, 3, 1)),
|
||||
// new CashFlow(4250, new DateTime(2008, 10, 30)),
|
||||
// new CashFlow(3250, new DateTime(2009, 2, 15)),
|
||||
// new CashFlow(2750, new DateTime(2009, 4, 1))
|
||||
// };
|
||||
//
|
||||
// IEnumerable<CashFlow> bigcfs = new CashFlow[]
|
||||
// {
|
||||
// new CashFlow(-10, new DateTime(2000, 1, 1)),
|
||||
// new CashFlow(10, new DateTime(2002, 1, 2)),
|
||||
// new CashFlow(20, new DateTime(2003, 1, 3))
|
||||
// };
|
||||
//
|
||||
// IEnumerable<CashFlow> negcfs = new CashFlow[]
|
||||
// {
|
||||
// new CashFlow(-10, new DateTime(2000, 1, 1)),
|
||||
// new CashFlow(-1, new DateTime(2002, 1, 2)),
|
||||
// new CashFlow(1, new DateTime(2003, 1, 3))
|
||||
// };
|
||||
//
|
||||
// IEnumerable<CashFlow> samedaysamecfs = new CashFlow[]
|
||||
// {
|
||||
// new CashFlow(-10, new DateTime(2000, 1, 1)),
|
||||
// new CashFlow(10, new DateTime(2000, 1, 1)),
|
||||
// };
|
||||
//
|
||||
// IEnumerable<CashFlow> samedaydifferentcfs = new CashFlow[]
|
||||
// {
|
||||
// new CashFlow(-10, new DateTime(2000, 1, 1)),
|
||||
// new CashFlow(100, new DateTime(2000, 1, 1)),
|
||||
// };
|
||||
//
|
||||
// IEnumerable<CashFlow> bigratecfs = new CashFlow[]
|
||||
// {
|
||||
// new CashFlow(-10, new DateTime(2000, 1, 1)),
|
||||
// new CashFlow(20, new DateTime(2000, 5, 30)),
|
||||
// };
|
||||
//
|
||||
// IEnumerable<CashFlow> zeroRate = new CashFlow[]
|
||||
// {
|
||||
// new CashFlow(-10, new DateTime(2000, 1, 1)),
|
||||
// new CashFlow(10, new DateTime(2003, 1, 1)),
|
||||
// };
|
||||
//
|
||||
// IEnumerable<CashFlow> doubleNegative = new CashFlow[]
|
||||
// {
|
||||
// new CashFlow(-10000, new DateTime(2008, 1, 1)),
|
||||
// new CashFlow(2750, new DateTime(2008, 3, 1)),
|
||||
// new CashFlow(-4250, new DateTime(2008, 10, 30)),
|
||||
// new CashFlow(3250, new DateTime(2009, 2, 15)),
|
||||
// new CashFlow(2750, new DateTime(2009, 4, 1))
|
||||
// };
|
||||
//
|
||||
// IEnumerable<CashFlow> badDoubleNegative = new CashFlow[]
|
||||
// {
|
||||
// new CashFlow(-10000, new DateTime(2008, 1, 1)),
|
||||
// new CashFlow(2750, new DateTime(2008, 3, 1)),
|
||||
// new CashFlow(-4250, new DateTime(2008, 10, 30)),
|
||||
// new CashFlow(3250, new DateTime(2009, 2, 15)),
|
||||
// new CashFlow(-2750, new DateTime(2009, 4, 1))
|
||||
// };
|
||||
//
|
||||
// double r = 0.09;
|
||||
// double tolerance = 0.0001;
|
||||
// int maxIters = 100;
|
||||
//
|
||||
// private TestContext testContextInstance;
|
||||
//
|
||||
// public TestContext TestContext
|
||||
// {
|
||||
// get { return testContextInstance; }
|
||||
// set { testContextInstance = value; }
|
||||
// }
|
||||
//
|
||||
// [TestMethod()]
|
||||
// public void CalculateXNPV()
|
||||
// {
|
||||
// Assert.AreEqual(2086.6476020315416570634272814M, Algorithms.CalculateXNPV(cfs, r));
|
||||
// Assert.AreEqual(-10.148147600710372651326920258M, Algorithms.CalculateXNPV(negcfs, 0.5));
|
||||
// Assert.AreEqual(4.9923725815954514810351876895M, Algorithms.CalculateXNPV(bigcfs, 0.3));
|
||||
// }
|
||||
//
|
||||
// [TestMethod]
|
||||
// public void FindBrackets()
|
||||
// {
|
||||
// var brackets = Algorithms.FindBrackets(Algorithms.CalculateXNPV, cfs);
|
||||
// Assert.IsTrue(brackets.First < 0.3733 && brackets.Second > 0.3733);
|
||||
//
|
||||
// brackets = Algorithms.FindBrackets(Algorithms.CalculateXNPV, bigcfs);
|
||||
// Assert.IsTrue(brackets.First < 0.5196 && brackets.Second > 0.5196);
|
||||
//
|
||||
// brackets = Algorithms.FindBrackets(Algorithms.CalculateXNPV, negcfs);
|
||||
// Assert.IsTrue(brackets.First < -0.6059 && brackets.Second > -0.6059);
|
||||
// }
|
||||
//
|
||||
// [TestMethod]
|
||||
// public void XIRRTest()
|
||||
// {
|
||||
// var irr = Algorithms.CalculateXIRR(cfs, tolerance, maxIters);
|
||||
// Assert.AreEqual(0.3733, irr.Value, 0.001);
|
||||
// Assert.AreEqual(ApproximateResultKind.ApproximateSolution, irr.Kind);
|
||||
//
|
||||
// irr = Algorithms.CalculateXIRR(bigcfs, tolerance, maxIters);
|
||||
// Assert.AreEqual(0.5196, irr.Value, 0.001);
|
||||
// Assert.AreEqual(ApproximateResultKind.ApproximateSolution, irr.Kind);
|
||||
//
|
||||
// irr = Algorithms.CalculateXIRR(negcfs, tolerance, maxIters);
|
||||
// Assert.AreEqual(-0.6059, irr.Value, 0.001);
|
||||
// Assert.AreEqual(ApproximateResultKind.ApproximateSolution, irr.Kind);
|
||||
//
|
||||
// irr = Algorithms.CalculateXIRR(samedaysamecfs, tolerance, maxIters);
|
||||
// Assert.AreEqual(ApproximateResultKind.NoSolutionWithinTolerance, irr.Kind);
|
||||
//
|
||||
// irr = Algorithms.CalculateXIRR(samedaydifferentcfs, tolerance, maxIters);
|
||||
// Assert.AreEqual(ApproximateResultKind.NoSolutionWithinTolerance, irr.Kind);
|
||||
//
|
||||
// irr = Algorithms.CalculateXIRR(bigratecfs, tolerance, maxIters);
|
||||
// Assert.AreEqual(4.40140, irr.Value, 0.001);
|
||||
// Assert.AreEqual(ApproximateResultKind.ApproximateSolution, irr.Kind);
|
||||
//
|
||||
// irr = Algorithms.CalculateXIRR(zeroRate, tolerance, maxIters);
|
||||
// Assert.AreEqual(0, irr.Value, 0.001);
|
||||
// Assert.AreEqual(ApproximateResultKind.ApproximateSolution, irr.Kind);
|
||||
//
|
||||
// irr = Algorithms.CalculateXIRR(doubleNegative, tolerance, maxIters);
|
||||
// Assert.AreEqual(-0.537055, irr.Value, 0.001);
|
||||
// Assert.AreEqual(ApproximateResultKind.ApproximateSolution, irr.Kind);
|
||||
//
|
||||
// irr = Algorithms.CalculateXIRR(badDoubleNegative, tolerance, maxIters);
|
||||
// Assert.AreEqual(ApproximateResultKind.NoSolutionWithinTolerance, irr.Kind);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@ -1,23 +0,0 @@
|
||||
using TridentGoalSeek;
|
||||
|
||||
namespace EvoCalculator.Core.FinanceFormulas
|
||||
{
|
||||
public class GoalXIRR : IGoalSeekAlgorithm
|
||||
{
|
||||
private readonly int x;
|
||||
|
||||
public GoalXIRR(int x)
|
||||
{
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public decimal Calculate(decimal inputVariable)
|
||||
{
|
||||
// Value[2]+=10;
|
||||
// ComputeValues
|
||||
// XIRR
|
||||
// return XIRR
|
||||
return inputVariable * this.x;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -70,7 +70,7 @@ namespace EvoCalculator.Core.Models.Calculation.Models.Prepared
|
||||
public double TransportTaxGr { get; set; }
|
||||
public double NsibBrutto { get; set; }
|
||||
public double NsibNetto { get; set; }
|
||||
public double NmperDeprecation { get; set; }
|
||||
public int NmperDeprecation { get; set; }
|
||||
public double DeprecationTime { get; set; }
|
||||
public double RatBonus { get; set; }
|
||||
public double NsBonus { get; set; }
|
||||
|
||||
@ -0,0 +1,136 @@
|
||||
using EvoCalculator.Core.Calculation.Columns;
|
||||
using EvoCalculator.Core.Models.Calculation.Models.Prepared;
|
||||
using Xunit;
|
||||
|
||||
namespace EvoCalculator.Core.Tests.Calculation.Columns
|
||||
{
|
||||
public class AcceptInsuranceTests
|
||||
{
|
||||
[Fact]
|
||||
public void AcceptInsuranceTest1()
|
||||
{
|
||||
var preparedValues = new PreparedValues()
|
||||
{
|
||||
Nmper = 30,
|
||||
};
|
||||
|
||||
var acceptKaskoColumn = new AcceptKaskoColumn(preparedValues.Nmper + 1)
|
||||
{
|
||||
Values = new[]
|
||||
{
|
||||
123666.666666667,
|
||||
0.00,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var acceptOsagoColumn = new AcceptOsagoColumn(preparedValues.Nmper + 1)
|
||||
{
|
||||
Values = new[]
|
||||
{
|
||||
30000,
|
||||
0.00,
|
||||
2727.27272727273,
|
||||
2727.27272727273,
|
||||
2727.27272727273,
|
||||
2727.27272727273,
|
||||
2727.27272727273,
|
||||
2727.27272727273,
|
||||
2727.27272727273,
|
||||
2727.27272727273,
|
||||
2727.27272727273,
|
||||
2727.27272727273,
|
||||
2727.27272727273,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var acceptInsuranceColumn = new AcceptInsuranceColumn(preparedValues.Nmper + 1);
|
||||
acceptInsuranceColumn.ComputeValues(acceptKaskoColumn, acceptOsagoColumn);
|
||||
|
||||
var expected = new[]
|
||||
{
|
||||
153666.6666666666,
|
||||
0.00,
|
||||
6991.64054336468,
|
||||
6991.64054336468,
|
||||
6991.64054336468,
|
||||
6991.64054336468,
|
||||
6991.64054336468,
|
||||
6991.64054336468,
|
||||
6991.64054336468,
|
||||
6991.64054336468,
|
||||
6991.64054336468,
|
||||
6991.64054336468,
|
||||
6991.64054336468,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
4264.36781609195,
|
||||
};
|
||||
|
||||
Assert.Equal(expected, acceptInsuranceColumn.Values);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
using EvoCalculator.Core.Calculation.Columns;
|
||||
using EvoCalculator.Core.Models.Calculation.Models.Prepared;
|
||||
using Xunit;
|
||||
|
||||
namespace EvoCalculator.Core.Tests.Calculation.Columns
|
||||
{
|
||||
public class AcceptKaskoTests
|
||||
{
|
||||
[Fact]
|
||||
public void AcceptKaskoTest1()
|
||||
{
|
||||
var preparedValues = new PreparedValues()
|
||||
{
|
||||
Nmper = 30,
|
||||
InsuranceKaskoNmper = 123666.666666667
|
||||
};
|
||||
|
||||
|
||||
var expected = new[]
|
||||
{
|
||||
123666.666666667,
|
||||
0.00,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
4264.367816091965,
|
||||
};
|
||||
|
||||
|
||||
var acceptKaskoColumn = new AcceptKaskoColumn(preparedValues.Nmper + 1);
|
||||
acceptKaskoColumn.ComputeValues(preparedValues);
|
||||
|
||||
Assert.Equal(expected, acceptKaskoColumn.Values);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
using EvoCalculator.Core.Calculation.Columns;
|
||||
using EvoCalculator.Core.Models.Calculation.Models.Prepared;
|
||||
using Xunit;
|
||||
|
||||
namespace EvoCalculator.Core.Tests.Calculation.Columns
|
||||
{
|
||||
public class AcceptOsagoTests
|
||||
{
|
||||
[Fact]
|
||||
public void AcceptOsagoTest1()
|
||||
{
|
||||
var preparedValues = new PreparedValues()
|
||||
{
|
||||
Nmper = 30,
|
||||
InsuranceOsago = 30000
|
||||
};
|
||||
|
||||
|
||||
var expected = new[]
|
||||
{
|
||||
30000.000000000004,
|
||||
0.00,
|
||||
2727.2727272727275,
|
||||
2727.2727272727275,
|
||||
2727.2727272727275,
|
||||
2727.2727272727275,
|
||||
2727.2727272727275,
|
||||
2727.2727272727275,
|
||||
2727.2727272727275,
|
||||
2727.2727272727275,
|
||||
2727.2727272727275,
|
||||
2727.2727272727275,
|
||||
2727.2727272727275,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
};
|
||||
|
||||
|
||||
var acceptOsagoColumn = new AcceptOsagoColumn(preparedValues.Nmper + 1);
|
||||
acceptOsagoColumn.ComputeValues(preparedValues);
|
||||
|
||||
Assert.Equal(expected, acceptOsagoColumn.Values);
|
||||
}
|
||||
}
|
||||
}
|
||||
251
EvoCalculator.Core.Tests/Calculation/Columns/AcceptSumTests.cs
Normal file
251
EvoCalculator.Core.Tests/Calculation/Columns/AcceptSumTests.cs
Normal file
@ -0,0 +1,251 @@
|
||||
using System;
|
||||
using EvoCalculator.Core.Calculation.Columns;
|
||||
using EvoCalculator.Core.Models.Calculation.Models.Prepared;
|
||||
using Xunit;
|
||||
|
||||
namespace EvoCalculator.Core.Tests.Calculation.Columns
|
||||
{
|
||||
public class AcceptSumTests
|
||||
{
|
||||
[Fact]
|
||||
public void AcceptSumTest1()
|
||||
{
|
||||
var preparedValues =
|
||||
new PreparedValues()
|
||||
{
|
||||
Nmper = 30,
|
||||
AcceptSum = 2500000
|
||||
};
|
||||
|
||||
var dateTempColumn = new DateTempColumn(preparedValues.Nmper + 1)
|
||||
{
|
||||
Values = new[]
|
||||
{
|
||||
new DateTime(2020, 10, 12),
|
||||
new DateTime(2020, 10, 12),
|
||||
new DateTime(2020, 11, 12),
|
||||
new DateTime(2020, 12, 12),
|
||||
new DateTime(2021, 1, 12),
|
||||
new DateTime(2021, 2, 12),
|
||||
new DateTime(2021, 3, 12),
|
||||
new DateTime(2021, 4, 12),
|
||||
new DateTime(2021, 5, 12),
|
||||
new DateTime(2021, 6, 12),
|
||||
new DateTime(2021, 7, 12),
|
||||
new DateTime(2021, 8, 12),
|
||||
new DateTime(2021, 9, 12),
|
||||
new DateTime(2021, 10, 12),
|
||||
new DateTime(2021, 11, 12),
|
||||
new DateTime(2021, 12, 12),
|
||||
new DateTime(2022, 1, 12),
|
||||
new DateTime(2022, 2, 12),
|
||||
new DateTime(2022, 3, 12),
|
||||
new DateTime(2022, 4, 12),
|
||||
new DateTime(2022, 5, 12),
|
||||
new DateTime(2022, 6, 12),
|
||||
new DateTime(2022, 7, 12),
|
||||
new DateTime(2022, 8, 12),
|
||||
new DateTime(2022, 9, 12),
|
||||
new DateTime(2022, 10, 12),
|
||||
new DateTime(2022, 11, 12),
|
||||
new DateTime(2022, 12, 12),
|
||||
new DateTime(2023, 1, 12),
|
||||
new DateTime(2023, 2, 12),
|
||||
new DateTime(2023, 3, 12),
|
||||
new DateTime(2023, 4, 12),
|
||||
new DateTime(2023, 5, 12),
|
||||
new DateTime(2023, 6, 12),
|
||||
new DateTime(2023, 7, 12),
|
||||
new DateTime(2023, 8, 12),
|
||||
new DateTime(2023, 9, 12),
|
||||
new DateTime(2023, 10, 12),
|
||||
new DateTime(2023, 11, 12),
|
||||
new DateTime(2023, 12, 12),
|
||||
new DateTime(2024, 1, 12),
|
||||
new DateTime(2024, 2, 12),
|
||||
new DateTime(2024, 3, 12),
|
||||
new DateTime(2024, 4, 12),
|
||||
new DateTime(2024, 5, 12),
|
||||
new DateTime(2024, 6, 12),
|
||||
new DateTime(2024, 7, 12),
|
||||
new DateTime(2024, 8, 12),
|
||||
new DateTime(2024, 9, 12),
|
||||
new DateTime(2024, 10, 12),
|
||||
new DateTime(2024, 11, 12),
|
||||
new DateTime(2024, 12, 12),
|
||||
new DateTime(2025, 1, 12),
|
||||
new DateTime(2025, 2, 12),
|
||||
new DateTime(2025, 3, 12),
|
||||
new DateTime(2025, 4, 12),
|
||||
new DateTime(2025, 5, 12),
|
||||
new DateTime(2025, 6, 12),
|
||||
new DateTime(2025, 7, 12),
|
||||
new DateTime(2025, 8, 12),
|
||||
new DateTime(2025, 9, 12),
|
||||
new DateTime(2025, 10, 12),
|
||||
new DateTime(2025, 11, 12),
|
||||
new DateTime(2025, 12, 12),
|
||||
new DateTime(2026, 1, 12),
|
||||
new DateTime(2026, 2, 12),
|
||||
new DateTime(2026, 3, 12),
|
||||
}
|
||||
};
|
||||
|
||||
var sumColumn = new SumColumn(preparedValues.Nmper + 1, dateTempColumn, null, null)
|
||||
{
|
||||
Values = new[]
|
||||
{
|
||||
-2542903.66268442,
|
||||
625000.00,
|
||||
120000.00,
|
||||
120000.00,
|
||||
120000.00,
|
||||
120000.00,
|
||||
120000.00,
|
||||
120000.00,
|
||||
120000.00,
|
||||
120000.00,
|
||||
120000.00,
|
||||
120000.00,
|
||||
108000.00,
|
||||
108000.00,
|
||||
108000.00,
|
||||
108000.00,
|
||||
108000.00,
|
||||
108000.00,
|
||||
108000.00,
|
||||
108000.00,
|
||||
108000.00,
|
||||
108000.00,
|
||||
108000.00,
|
||||
96000.00,
|
||||
96000.00,
|
||||
96000.00,
|
||||
96000.00,
|
||||
96000.00,
|
||||
96000.00,
|
||||
96000.00,
|
||||
25000.00,
|
||||
}
|
||||
};
|
||||
|
||||
var vatColumn = new VATColumn(preparedValues.Nmper + 1)
|
||||
{
|
||||
Values = new[]
|
||||
{
|
||||
742000.00,
|
||||
125000.00,
|
||||
24000.00,
|
||||
24000.00,
|
||||
24000.00,
|
||||
24000.00,
|
||||
24000.00,
|
||||
24000.00,
|
||||
24000.00,
|
||||
24000.00,
|
||||
24000.00,
|
||||
24000.00,
|
||||
21600.00,
|
||||
21600.00,
|
||||
21600.00,
|
||||
21600.00,
|
||||
21600.00,
|
||||
21600.00,
|
||||
21600.00,
|
||||
21600.00,
|
||||
21600.00,
|
||||
21600.00,
|
||||
21600.00,
|
||||
19200.00,
|
||||
19200.00,
|
||||
19200.00,
|
||||
19200.00,
|
||||
19200.00,
|
||||
19200.00,
|
||||
19200.00,
|
||||
5000.00,
|
||||
}
|
||||
};
|
||||
|
||||
var sumWithVatColumn = new SumWithVATColumn(preparedValues.Nmper + 1)
|
||||
{
|
||||
Values = new[]
|
||||
{
|
||||
4452000.00,
|
||||
750000.00,
|
||||
144000.00,
|
||||
144000.00,
|
||||
144000.00,
|
||||
144000.00,
|
||||
144000.00,
|
||||
144000.00,
|
||||
144000.00,
|
||||
144000.00,
|
||||
144000.00,
|
||||
144000.00,
|
||||
129600.00,
|
||||
129600.00,
|
||||
129600.00,
|
||||
129600.00,
|
||||
129600.00,
|
||||
129600.00,
|
||||
129600.00,
|
||||
129600.00,
|
||||
129600.00,
|
||||
129600.00,
|
||||
129600.00,
|
||||
115200.00,
|
||||
115200.00,
|
||||
115200.00,
|
||||
115200.00,
|
||||
115200.00,
|
||||
115200.00,
|
||||
115200.00,
|
||||
30000.00,
|
||||
}
|
||||
};
|
||||
|
||||
var expected = new[]
|
||||
{
|
||||
2500000,
|
||||
421159.0296495957,
|
||||
80862.53369272237,
|
||||
80862.53369272237,
|
||||
80862.53369272237,
|
||||
80862.53369272237,
|
||||
80862.53369272237,
|
||||
80862.53369272237,
|
||||
80862.53369272237,
|
||||
80862.53369272237,
|
||||
80862.53369272237,
|
||||
80862.53369272237,
|
||||
72776.280323450133,
|
||||
72776.280323450133,
|
||||
72776.280323450133,
|
||||
72776.280323450133,
|
||||
72776.280323450133,
|
||||
72776.280323450133,
|
||||
72776.280323450133,
|
||||
72776.280323450133,
|
||||
72776.280323450133,
|
||||
72776.280323450133,
|
||||
72776.280323450133,
|
||||
64690.026954177898,
|
||||
64690.026954177898,
|
||||
64690.026954177898,
|
||||
64690.026954177898,
|
||||
64690.026954177898,
|
||||
64690.026954177898,
|
||||
64690.026954177898,
|
||||
16846.361185983827,
|
||||
};
|
||||
|
||||
|
||||
var acceptSumColumn = new AcceptSumColumn(preparedValues.Nmper + 1);
|
||||
acceptSumColumn.ComputeValues(preparedValues, sumColumn, vatColumn, sumWithVatColumn);
|
||||
|
||||
var values = acceptSumColumn.Values;
|
||||
Assert.Equal(expected, values);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
using EvoCalculator.Core.Calculation.Columns;
|
||||
using EvoCalculator.Core.Models.Calculation.Models.Prepared;
|
||||
using Xunit;
|
||||
|
||||
namespace EvoCalculator.Core.Tests.Calculation.Columns
|
||||
{
|
||||
public class DeprecationLDTests
|
||||
{
|
||||
[Fact]
|
||||
public void DeprecationLDTest1()
|
||||
{
|
||||
var preparedValues = new PreparedValues()
|
||||
{
|
||||
BalanceHolder = 100000001,
|
||||
NmperDeprecation = 37,
|
||||
DeprecationTime = 5.60,
|
||||
AcceptSum = 2500000
|
||||
};
|
||||
|
||||
|
||||
var deprecationLDColumn = new DeprecationLDColumn(preparedValues.NmperDeprecation + 2);
|
||||
deprecationLDColumn.ComputeValues(preparedValues);
|
||||
|
||||
var expected = new[]
|
||||
{
|
||||
2500000.00,
|
||||
0.00,
|
||||
140000.00,
|
||||
132160.00,
|
||||
124759.04,
|
||||
117772.53376,
|
||||
111177.27186944,
|
||||
104951.344644751,
|
||||
99074.0693446453,
|
||||
93525.9214613451,
|
||||
88288.4698595098,
|
||||
83344.3155473772,
|
||||
78677.0338767241,
|
||||
74271.1199796276,
|
||||
70111.9372607684,
|
||||
66185.6687741654,
|
||||
62479.2713228121,
|
||||
58980.4321287346,
|
||||
55677.5279295255,
|
||||
52559.5863654721,
|
||||
49616.2495290057,
|
||||
46837.7395553813,
|
||||
44214.82614028,
|
||||
41738.7958764243,
|
||||
39401.4233073445,
|
||||
37194.9436021332,
|
||||
35112.0267604138,
|
||||
33145.7532618306,
|
||||
31289.5910791681,
|
||||
29537.3739787347,
|
||||
27883.2810359255,
|
||||
26321.8172979137,
|
||||
24847.7955292305,
|
||||
23456.3189795936,
|
||||
22142.7651167364,
|
||||
20902.7702701992,
|
||||
19732.215135068,
|
||||
18627.2110875042,
|
||||
314001.558332213,
|
||||
};
|
||||
|
||||
|
||||
var values = deprecationLDColumn.Values;
|
||||
Assert.Equal(expected, values, new DoubleArrayComparer());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,189 @@
|
||||
using EvoCalculator.Core.Calculation.Columns;
|
||||
using EvoCalculator.Core.Models.Calculation.Models.Prepared;
|
||||
using Xunit;
|
||||
|
||||
namespace EvoCalculator.Core.Tests.Calculation.Columns
|
||||
{
|
||||
public class DeprecationLPTests
|
||||
{
|
||||
[Fact]
|
||||
public void DeprecationLPTest1()
|
||||
{
|
||||
var preparedValues = new PreparedValues()
|
||||
{
|
||||
BalanceHolder = 100000001,
|
||||
Nmper = 30
|
||||
};
|
||||
|
||||
var acceptSumColumn = new AcceptSumColumn(preparedValues.Nmper + 1)
|
||||
{
|
||||
Values = new[]
|
||||
{
|
||||
2224393.53099731,
|
||||
421159.029649596,
|
||||
80862.533692722398,
|
||||
80862.533692722398,
|
||||
80862.533692722398,
|
||||
80862.533692722398,
|
||||
80862.533692722398,
|
||||
80862.533692722398,
|
||||
80862.533692722398,
|
||||
80862.533692722398,
|
||||
80862.533692722398,
|
||||
80862.533692722398,
|
||||
72776.280323450104,
|
||||
72776.280323450104,
|
||||
72776.280323450104,
|
||||
72776.280323450104,
|
||||
72776.280323450104,
|
||||
72776.280323450104,
|
||||
72776.280323450104,
|
||||
72776.280323450104,
|
||||
72776.280323450104,
|
||||
72776.280323450104,
|
||||
72776.280323450104,
|
||||
64690.026954177898,
|
||||
64690.026954177898,
|
||||
64690.026954177898,
|
||||
64690.026954177898,
|
||||
64690.026954177898,
|
||||
64690.026954177898,
|
||||
64690.026954177898,
|
||||
16846.3611859838,
|
||||
}
|
||||
};
|
||||
|
||||
var deprecationLPColumn = new DeprecationLPColumn(preparedValues.Nmper + 1);
|
||||
deprecationLPColumn.ComputeValues(preparedValues, acceptSumColumn);
|
||||
|
||||
var expected = new[]
|
||||
{
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
};
|
||||
|
||||
|
||||
var values = deprecationLPColumn.Values;
|
||||
Assert.Equal(expected, values);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DeprecationLPTest2()
|
||||
{
|
||||
var preparedValues = new PreparedValues()
|
||||
{
|
||||
BalanceHolder = 100000000,
|
||||
Nmper = 30
|
||||
};
|
||||
|
||||
var acceptSumColumn = new AcceptSumColumn(preparedValues.Nmper + 1)
|
||||
{
|
||||
Values = new[]
|
||||
{
|
||||
2224393.53099731,
|
||||
421159.029649596,
|
||||
80862.533692722398,
|
||||
80862.533692722398,
|
||||
80862.533692722398,
|
||||
80862.533692722398,
|
||||
80862.533692722398,
|
||||
80862.533692722398,
|
||||
80862.533692722398,
|
||||
80862.533692722398,
|
||||
80862.533692722398,
|
||||
80862.533692722398,
|
||||
72776.280323450104,
|
||||
72776.280323450104,
|
||||
72776.280323450104,
|
||||
72776.280323450104,
|
||||
72776.280323450104,
|
||||
72776.280323450104,
|
||||
72776.280323450104,
|
||||
72776.280323450104,
|
||||
72776.280323450104,
|
||||
72776.280323450104,
|
||||
72776.280323450104,
|
||||
64690.026954177898,
|
||||
64690.026954177898,
|
||||
64690.026954177898,
|
||||
64690.026954177898,
|
||||
64690.026954177898,
|
||||
64690.026954177898,
|
||||
64690.026954177898,
|
||||
16846.3611859838,
|
||||
}
|
||||
};
|
||||
|
||||
var deprecationLPColumn = new DeprecationLPColumn(preparedValues.Nmper + 1);
|
||||
deprecationLPColumn.ComputeValues(preparedValues, acceptSumColumn);
|
||||
|
||||
var expected = new[]
|
||||
{
|
||||
2500000.00,
|
||||
421159.029649596,
|
||||
80862.5336927224,
|
||||
80862.5336927224,
|
||||
80862.5336927224,
|
||||
80862.5336927224,
|
||||
80862.5336927224,
|
||||
80862.5336927224,
|
||||
80862.5336927224,
|
||||
80862.5336927224,
|
||||
80862.5336927224,
|
||||
80862.5336927224,
|
||||
72776.2803234501,
|
||||
72776.2803234501,
|
||||
72776.2803234501,
|
||||
72776.2803234501,
|
||||
72776.2803234501,
|
||||
72776.2803234501,
|
||||
72776.2803234501,
|
||||
72776.2803234501,
|
||||
72776.2803234501,
|
||||
72776.2803234501,
|
||||
72776.2803234501,
|
||||
64690.0269541779,
|
||||
64690.0269541779,
|
||||
64690.0269541779,
|
||||
64690.0269541779,
|
||||
64690.0269541779,
|
||||
64690.0269541779,
|
||||
64690.0269541779,
|
||||
16846.3611859838,
|
||||
};
|
||||
|
||||
|
||||
var values = deprecationLPColumn.Values;
|
||||
Assert.Equal(expected, values, new DoubleArrayComparer());
|
||||
}
|
||||
}
|
||||
}
|
||||
153
EvoCalculator.Core.Tests/Calculation/Columns/DeprecationTests.cs
Normal file
153
EvoCalculator.Core.Tests/Calculation/Columns/DeprecationTests.cs
Normal file
@ -0,0 +1,153 @@
|
||||
using EvoCalculator.Core.Calculation.Columns;
|
||||
using EvoCalculator.Core.Models.Calculation.Models.Prepared;
|
||||
using Xunit;
|
||||
|
||||
namespace EvoCalculator.Core.Tests.Calculation.Columns
|
||||
{
|
||||
public class DeprecationTests
|
||||
{
|
||||
[Fact]
|
||||
public void DepreactionTest1()
|
||||
{
|
||||
var preparedValues = new PreparedValues()
|
||||
{
|
||||
NmperDeprecation = 37,
|
||||
Nmper = 30
|
||||
};
|
||||
|
||||
var deprecationLPColumn = new DeprecationLPColumn(preparedValues.Nmper + 1)
|
||||
{
|
||||
Values = new[]
|
||||
{
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
}
|
||||
};
|
||||
|
||||
var deprectionLDColumn = new DeprecationLDColumn(preparedValues.NmperDeprecation + 2)
|
||||
{
|
||||
Values = new[]
|
||||
{
|
||||
2500000.00,
|
||||
0.00,
|
||||
140000.00,
|
||||
132160.00,
|
||||
124759.04,
|
||||
117772.53376,
|
||||
111177.27186944,
|
||||
104951.344644751,
|
||||
99074.0693446453,
|
||||
93525.9214613451,
|
||||
88288.4698595098,
|
||||
83344.3155473772,
|
||||
78677.0338767241,
|
||||
74271.1199796276,
|
||||
70111.9372607684,
|
||||
66185.6687741654,
|
||||
62479.2713228121,
|
||||
58980.4321287346,
|
||||
55677.5279295255,
|
||||
52559.5863654721,
|
||||
49616.2495290057,
|
||||
46837.7395553813,
|
||||
44214.82614028,
|
||||
41738.7958764243,
|
||||
39401.4233073445,
|
||||
37194.9436021332,
|
||||
35112.0267604138,
|
||||
33145.7532618306,
|
||||
31289.5910791681,
|
||||
29537.3739787347,
|
||||
27883.2810359255,
|
||||
26321.8172979137,
|
||||
24847.7955292305,
|
||||
23456.3189795936,
|
||||
22142.7651167364,
|
||||
20902.7702701992,
|
||||
19732.215135068,
|
||||
18627.2110875042,
|
||||
314001.558332213,
|
||||
}
|
||||
};
|
||||
|
||||
var deprecationColumn = new DeprecationColumn(preparedValues.NmperDeprecation + 2);
|
||||
deprecationColumn.ComputeValues(deprecationLPColumn, deprectionLDColumn);
|
||||
|
||||
var expected = new[]
|
||||
{
|
||||
2500000.00,
|
||||
0.00,
|
||||
140000.00,
|
||||
132160.00,
|
||||
124759.04,
|
||||
117772.53376,
|
||||
111177.27186944,
|
||||
104951.344644751,
|
||||
99074.0693446453,
|
||||
93525.9214613451,
|
||||
88288.4698595098,
|
||||
83344.3155473772,
|
||||
78677.0338767241,
|
||||
74271.1199796276,
|
||||
70111.9372607684,
|
||||
66185.6687741654,
|
||||
62479.2713228121,
|
||||
58980.4321287346,
|
||||
55677.5279295255,
|
||||
52559.5863654721,
|
||||
49616.2495290057,
|
||||
46837.7395553813,
|
||||
44214.82614028,
|
||||
41738.7958764243,
|
||||
39401.4233073445,
|
||||
37194.9436021332,
|
||||
35112.0267604138,
|
||||
33145.7532618306,
|
||||
31289.5910791681,
|
||||
29537.3739787347,
|
||||
27883.2810359255,
|
||||
26321.8172979137,
|
||||
24847.7955292305,
|
||||
23456.3189795936,
|
||||
22142.7651167364,
|
||||
20902.7702701992,
|
||||
19732.215135068,
|
||||
18627.2110875042,
|
||||
314001.558332213,
|
||||
};
|
||||
|
||||
|
||||
var values = deprecationColumn.Values;
|
||||
Assert.Equal(expected, values, new DoubleArrayComparer());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,130 @@
|
||||
using EvoCalculator.Core.Calculation.Columns;
|
||||
using EvoCalculator.Core.Models.Calculation.Models.Prepared;
|
||||
using Xunit;
|
||||
|
||||
namespace EvoCalculator.Core.Tests.Calculation.Columns
|
||||
{
|
||||
public class NPVBonusExpensesTests
|
||||
{
|
||||
[Fact]
|
||||
public void NPVBonusExpensesTest1()
|
||||
{
|
||||
var preparedValue = new PreparedValues
|
||||
{
|
||||
SalaryRate = 0.3,
|
||||
MarketRate = 0.01,
|
||||
DistrictRate = 0.02,
|
||||
RatBonus = 360.00,
|
||||
NsBonus = 90.00,
|
||||
NsibBonus = 97.014,
|
||||
BonusFix = 0.00,
|
||||
BonusBase = 2003933.33333333,
|
||||
Bonus = 0.011,
|
||||
Nmper = 30
|
||||
};
|
||||
|
||||
|
||||
var npvBonusExpensesColumn = new NPVBonusExpensesColumn(preparedValue.Nmper + 1);
|
||||
npvBonusExpensesColumn.ComputeValues(preparedValue);
|
||||
|
||||
var expected = new[]
|
||||
{
|
||||
-30248.3858126666,
|
||||
-732.451746,
|
||||
-29515.9340666666,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
};
|
||||
|
||||
|
||||
Assert.Equal(expected, npvBonusExpensesColumn.Values, new DoubleArrayComparer());
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public void NPVBonusExpensesTest2()
|
||||
{
|
||||
var preparedValue = new PreparedValues
|
||||
{
|
||||
SalaryRate = 0.3,
|
||||
MarketRate = 0.01,
|
||||
DistrictRate = 0.02,
|
||||
RatBonus = 360.00,
|
||||
NsBonus = 90.00,
|
||||
NsibBonus = 97.014,
|
||||
BonusFix = 20000.00,
|
||||
BonusBase = 2003933.33333333,
|
||||
Bonus = 0.011,
|
||||
Nmper = 30
|
||||
};
|
||||
|
||||
|
||||
var npvBonusExpensesColumn = new NPVBonusExpensesColumn(preparedValue.Nmper + 1);
|
||||
npvBonusExpensesColumn.ComputeValues(preparedValue);
|
||||
|
||||
var expected = new[]
|
||||
{
|
||||
-20732.451746,
|
||||
-732.451746,
|
||||
-20000.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
0.00,
|
||||
};
|
||||
|
||||
|
||||
Assert.Equal(expected, npvBonusExpensesColumn.Values, new DoubleArrayComparer());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -176,7 +176,7 @@ namespace EvoCalculator.Core.Tests.Calculation.Columns
|
||||
, percentPaymentColumn);
|
||||
sumColumn.ComputeValues(Convert.ToDecimal(preparedValues.IrrExpected));
|
||||
var values = sumColumn.Values;
|
||||
Assert.Equal(expected, values);
|
||||
Assert.Equal(expected, values, new DoubleArrayComparer(100));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@ -306,7 +306,7 @@ namespace EvoCalculator.Core.Tests.Calculation.Columns
|
||||
, percentPaymentColumn);
|
||||
sumColumn.ComputeValues(Convert.ToDecimal(preparedValues.IrrExpected));
|
||||
var values = sumColumn.Values;
|
||||
Assert.Equal(expected, values);
|
||||
Assert.Equal(expected, values, new DoubleArrayComparer(100));
|
||||
}
|
||||
}
|
||||
}
|
||||
29
EvoCalculator.Core.Tests/DoubleArrayComparer.cs
Normal file
29
EvoCalculator.Core.Tests/DoubleArrayComparer.cs
Normal file
@ -0,0 +1,29 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace EvoCalculator.Core.Tests
|
||||
{
|
||||
public class DoubleArrayComparer : IEqualityComparer<double>
|
||||
{
|
||||
private double _tolerance = 0.001;
|
||||
|
||||
public DoubleArrayComparer(double tolerance)
|
||||
{
|
||||
this._tolerance = tolerance;
|
||||
}
|
||||
public DoubleArrayComparer()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public bool Equals(double x, double y)
|
||||
{
|
||||
return Math.Abs(x - y) < _tolerance;
|
||||
}
|
||||
|
||||
public int GetHashCode(double obj)
|
||||
{
|
||||
return obj.GetHashCode();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user