Skip to content

Commit

Permalink
Add tests for integral characteristics calculators
Browse files Browse the repository at this point in the history
  • Loading branch information
ChainsManipulator committed Nov 7, 2024
1 parent 4fe79ba commit 3586128
Show file tree
Hide file tree
Showing 43 changed files with 331 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ public class ATSkewTests : FullCalculatorsTests<ATSkew>
[TestCase(2, 0)]
[TestCase(5, 0)]
[TestCase(6, 0.6)]
[TestCase(7, 0)]
[TestCase(8, -1)]
public void CalculationTest(int index, double value)
{
ChainCharacteristicTest(index, Link.NotApplied, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,20 @@ public class AlphabetCardinalityTests : FullCalculatorsTests<AlphabetCardinality
[TestCase(3, 2)]
[TestCase(4, 1)]
[TestCase(5, 4)]
[TestCase(6, 4)]
[TestCase(7, 2)]
[TestCase(8, 1)]
[TestCase(9, 3)]
[TestCase(10, 3)]
[TestCase(11, 3)]
[TestCase(12, 3)]
[TestCase(13, 3)]
[TestCase(14, 3)]
[TestCase(15, 3)]
[TestCase(16, 3)]
[TestCase(17, 3)]
[TestCase(18, 0)]
[TestCase(19, 1)]
public void ChainCalculationTest(int index, double value)
{
ChainCharacteristicTest(index, Link.NotApplied, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,36 @@ public class AlphabeticAverageRemotenessTests : FullCalculatorsTests<AlphabeticA
[TestCase(0, Link.End, 0.6417)]
[TestCase(0, Link.Both, 0.6832)]
[TestCase(0, Link.Cycle, 0.7786)]

[TestCase(2, Link.None, 0.548746875)]
[TestCase(2, Link.Start, 0.6649604)]
[TestCase(2, Link.End, 0.5877443751)]
[TestCase(2, Link.Both, 0.65961189)]
[TestCase(2, Link.Cycle, 0.75384077985)]

[TestCase(30, Link.Start, 0.7169925)]
public void ChainCalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
}

/// <summary>
/// No intervals test.
/// </summary>
/// <param name="index">
/// Full sequence index in <see cref="ChainsStorage"/>.
/// </param>
/// <param name="link">
/// The link.
/// </param>
/// <param name="value">
/// The value.
/// </param>
[TestCase(3, Link.None, 0)]
[TestCase(5, Link.None, 0)]
[TestCase(7, Link.None, 0)]
public void NoIntervalsTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,36 @@ public class AlphabeticDepthTests : FullCalculatorsTests<AlphabeticDepth>
[TestCase(0, Link.End, 6.4165)]
[TestCase(0, Link.Both, 8.8815)]
[TestCase(0, Link.Cycle, 7.7856)]

[TestCase(2, Link.None, 3.29248125)]
[TestCase(2, Link.Start, 6.649604)]
[TestCase(2, Link.End, 5.877443751)]
[TestCase(2, Link.Both, 9.2345665)]
[TestCase(2, Link.Cycle, 7.5384077985)]

[TestCase(30, Link.Start, 3.5849625)]
public void ChainCalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
}

/// <summary>
/// No intervals test.
/// </summary>
/// <param name="index">
/// Full sequence index in <see cref="ChainsStorage"/>.
/// </param>
/// <param name="link">
/// The link.
/// </param>
/// <param name="value">
/// The value.
/// </param>
[TestCase(3, Link.None, 0)]
[TestCase(5, Link.None, 0)]
[TestCase(7, Link.None, 0)]
public void NoIntervalsTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,36 @@ public class ArithmeticMeanTests : FullCalculatorsTests<ArithmeticMean>
[TestCase(0, Link.End, 2.4)]
[TestCase(0, Link.Both, 2.5385)]
[TestCase(0, Link.Cycle, 3)]

[TestCase(2, Link.None, 2.666666666666667)]
[TestCase(2, Link.Start, 3.2)]
[TestCase(2, Link.End, 2.8)]
[TestCase(2, Link.Both, 3.142857142857)]
[TestCase(2, Link.Cycle, 4)]

[TestCase(30, Link.Start, 1.8)]
public void ChainCalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
}

/// <summary>
/// No intervals test.
/// </summary>
/// <param name="index">
/// Full sequence index in <see cref="ChainsStorage"/>.
/// </param>
/// <param name="link">
/// The link.
/// </param>
/// <param name="value">
/// The value.
/// </param>
[TestCase(3, Link.None, 0)]
[TestCase(5, Link.None, 0)]
[TestCase(7, Link.None, 0)]
public void NoIntervalsTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public class AverageRemotenessATSkewTests : FullCalculatorsTests<AverageRemotene
[TestCase(1, Link.Both, -0.0261)]
[TestCase(1, Link.Cycle, 0.0811)]

[TestCase(2, Link.None, 1)]
[TestCase(2, Link.Start, 0.195286715)]
[TestCase(2, Link.End, 0.386852807)]
[TestCase(2, Link.Both, 0.08132063)]
[TestCase(2, Link.Cycle, 0.18247041)]
public void CalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public class AverageRemotenessGCRatioTests : FullCalculatorsTests<AverageRemoten
[TestCase(1, Link.Both, 225.8582)]
[TestCase(1, Link.Cycle, 249.4390)]

[TestCase(2, Link.None, 91.11669201)]
[TestCase(2, Link.Start, 234.7454074)]
[TestCase(2, Link.End, 287.9621351)]
[TestCase(2, Link.Both, 236.5111966)]
[TestCase(2, Link.Cycle, 273.3951389)]
public void CalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public class AverageRemotenessGCSkewTests : FullCalculatorsTests<AverageRemotene
[TestCase(1, Link.Both, -0.0172)]
[TestCase(1, Link.Cycle, 0.0278)]

[TestCase(2, Link.None, -1)]
[TestCase(2, Link.Start, 0.487496188)]
[TestCase(2, Link.End, 0.527321204)]
[TestCase(2, Link.Both, 0.572664908)]
[TestCase(2, Link.Cycle, 0.611832142)]
public void CalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public class AverageRemotenessGCToATRatioTests : FullCalculatorsTests<AverageRem
[TestCase(1, Link.Both, 1.2505)]
[TestCase(1, Link.Cycle, 1.4932)]

[TestCase(2, Link.None, 0.386852807)]
[TestCase(2, Link.Start, 0.894883976)]
[TestCase(2, Link.End, 1.309482246)]
[TestCase(2, Link.Both, 0.978885023)]
[TestCase(2, Link.Cycle, 1.06305297)]
public void CalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public class AverageRemotenessMKSkewTests : FullCalculatorsTests<AverageRemotene
[TestCase(1, Link.Both, -0.0080)]
[TestCase(1, Link.Cycle, 0.0661)]

[TestCase(2, Link.None, 3.26649924)]
[TestCase(2, Link.Start, -0.632100018)]
[TestCase(2, Link.End, -0.667775426)]
[TestCase(2, Link.Both, -1.157935537)]
[TestCase(2, Link.Cycle, -1.203443349)]
public void CalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public class AverageRemotenessRYSkewTests : FullCalculatorsTests<AverageRemotene
[TestCase(1, Link.Both, -0.0862)]
[TestCase(1, Link.Cycle, 0.2050)]

[TestCase(2, Link.None, 1.444165399575)]
[TestCase(2, Link.Start, 1.6566498)]
[TestCase(2, Link.End, 2.369195368)]
[TestCase(2, Link.Both, 1.550897715)]
[TestCase(2, Link.Cycle, 2.14199532)]
public void CalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ public class AverageRemotenessSWSkewTests : FullCalculatorsTests<AverageRemotene
[TestCase(1, Link.Both, 0.4525)]
[TestCase(1, Link.Cycle, 0.8239)]

[TestCase(2, Link.None, -1.4441654)]
[TestCase(2, Link.Start, -0.275739699)]
[TestCase(2, Link.End, 0.680567977)]
[TestCase(2, Link.Both, -0.051016497)]
[TestCase(2, Link.Cycle, 0.162159139)]
public void CalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ public class AverageRemotenessTests : FullCalculatorsTests<AverageRemoteness>
[TestCase(0, Link.End, 1.017)]
[TestCase(0, Link.Both, 1.0828)]
[TestCase(0, Link.Cycle, 1.234)]

[TestCase(2, Link.None, 1.09749375)]
[TestCase(2, Link.Start, 1.3299208)]
[TestCase(2, Link.End, 1.17548874963)]
[TestCase(2, Link.Both, 1.31922378713)]
[TestCase(2, Link.Cycle, 1.5076815597)]

[TestCase(30, Link.Start, 0.7169925)]
public void ChainCalculationTest(int index, Link link, double value)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public class CuttingLengthTests : FullCalculatorsTests<CuttingLength>
/// <param name="value">
/// The value.
/// </param>
[TestCase(0, Link.NotApplied, 3)]
public void ChainCalculationTest(int index, Link link, double value)
[TestCase(0, 3)]
public void ChainCalculationTest(int index, double value)
{
ChainCharacteristicTest(index, link, value);
ChainCharacteristicTest(index, Link.NotApplied, value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public class CuttingLengthVocabularyEntropyTests : FullCalculatorsTests<CuttingL
/// <param name="value">
/// The value.
/// </param>
[TestCase(0, Link.NotApplied, 3)]
public void CalculationTest(int index, Link link, double value)
[TestCase(0, 3)]
public void CalculationTest(int index, double value)
{
ChainCharacteristicTest(index, link, value);
ChainCharacteristicTest(index, Link.NotApplied, value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ public class DepthTests : FullCalculatorsTests<Depth>
[TestCase(0, Link.End, 10.1699)]
[TestCase(0, Link.Both, 14.0768)]
[TestCase(0, Link.Cycle, 12.3399)]

[TestCase(2, Link.None, 6.5849625)]
[TestCase(2, Link.Start, 13.299208)]
[TestCase(2, Link.End, 11.7548875)]
[TestCase(2, Link.Both, 18.469133)]
[TestCase(2, Link.Cycle, 15.076815597)]

[TestCase(30, Link.Start, 3.5849625)]
public void CalculationTest(int index, Link link, double value)
{
ChainCharacteristicTest(index, link, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ public class DescriptiveInformationTests : FullCalculatorsTests<DescriptiveInfor
[TestCase(0, Link.End, 2.383831871)]
[TestCase(0, Link.Both, 2.52382717296366)]
[TestCase(0, Link.Cycle, 2.971)]

[TestCase(2, Link.None, 2.314622766)]
[TestCase(2, Link.Start, 2.9611915354687)]
[TestCase(2, Link.End, 2.56417770797363)]
[TestCase(2, Link.Both, 2.8867851948)]
[TestCase(2, Link.Cycle, 3.389245277)]

[TestCase(30, Link.Start, 1.71450693)]
public void ChainCalculationTest(int index, Link link, double value)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,34 @@ public class ElementsCountTests : FullCalculatorsTests<ElementsCount>
/// <param name="value">
/// The value.
/// </param>
[TestCase(0, Link.NotApplied, 10)]
public void ChainCalculationTest(int index, Link link, double value)
[TestCase(0, 10)]
[TestCase(1, 10)]
[TestCase(2, 10)]
[TestCase(3, 2)]
[TestCase(4, 4)]
[TestCase(5, 4)]
[TestCase(6, 7)]
[TestCase(7, 2)]
[TestCase(8, 4)]
[TestCase(9, 9)]
[TestCase(10, 9)]
[TestCase(11, 9)]
[TestCase(12, 9)]
[TestCase(13, 9)]
[TestCase(14, 9)]
[TestCase(15, 9)]
[TestCase(16, 9)]
[TestCase(17, 9)]
[TestCase(18, 0)]
[TestCase(19, 1)]
[TestCase(20, 1)]
[TestCase(21, 2)]
[TestCase(22, 2)]
[TestCase(24, 2)]
[TestCase(26, 3)]
[TestCase(28, 3)]
public void ChainCalculationTest(int index, double value)
{
ChainCharacteristicTest(index, link, value);
ChainCharacteristicTest(index, Link.NotApplied, value);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public class GCRatioTests : FullCalculatorsTests<GCRatio>
/// The value.
/// </param>
[TestCase(1, 40)]
[TestCase(2, 60)]
[TestCase(3, 100)]
[TestCase(4, 100)]
[TestCase(5, 50)]
[TestCase(6, 28.57142857)]
public void CalculationTest(int index, double value)
{
ChainCharacteristicTest(index, Link.NotApplied, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public class GCSkewTests : FullCalculatorsTests<GCSkew>
/// The value.
/// </param>
[TestCase(1, 0)]
[TestCase(2, -0.666666666667)]
[TestCase(3, 0)]
[TestCase(4, -1)]
[TestCase(5, 0)]
[TestCase(6, 0)]
public void CalculationTest(int index, double value)
{
ChainCharacteristicTest(index, Link.NotApplied, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ public class GCToATRatioTests : FullCalculatorsTests<GCToATRatio>
/// The value.
/// </param>
[TestCase(1, 0.6666)]
[TestCase(2, 1.5)]
[TestCase(5, 1)]
[TestCase(6, 0.4)]
[TestCase(7, 0)]
[TestCase(8, 0)]
public void CalculationTest(int index, double value)
{
ChainCharacteristicTest(index, Link.NotApplied, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ public class GeometricMeanTests : FullCalculatorsTests<GeometricMean>
[TestCase(0, Link.End, 2.0237)]
[TestCase(0, Link.Both, 2.1182)]
[TestCase(0, Link.Cycle, 2.3522)]

[TestCase(2, Link.None, 2.139826387867)]
[TestCase(2, Link.Start, 2.513888742864)]
[TestCase(2, Link.End, 2.25869387)]
[TestCase(2, Link.Both, 2.4953181811241978)]
[TestCase(2, Link.Cycle, 2.843527111557)]

[TestCase(30, Link.Start, 1.6437518295)]
public void CalculationTest(int index, Link link, double value)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ public class IdentificationInformationTests : FullCalculatorsTests<Identificatio
[TestCase(0, Link.End, 1.2532824857)]
[TestCase(0, Link.Both, 1.335618955)]
[TestCase(0, Link.Cycle, 1.571)]

[TestCase(2, Link.None, 1.210777084415)]
[TestCase(2, Link.Start, 1.5661778097771987)]
[TestCase(2, Link.End, 1.35849625)]
[TestCase(2, Link.Both, 1.5294637608763)]
[TestCase(2, Link.Cycle, 1.76096404744368)]

[TestCase(30, Link.Start, 0.77779373752225)]
public void ChainCalculationTest(int index, Link link, double value)
{
Expand Down
Loading

0 comments on commit 3586128

Please sign in to comment.