Skip to content

Commit

Permalink
Define INumber on Amount.
Browse files Browse the repository at this point in the history
  • Loading branch information
Corniel committed Jan 24, 2024
1 parent 67ea23b commit 7340155
Show file tree
Hide file tree
Showing 3 changed files with 314 additions and 330 deletions.
11 changes: 0 additions & 11 deletions specs/Qowaiv.Specs/Svo_numeric_contract_specs.cs
Expand Up @@ -25,7 +25,6 @@ public void Abs(Type svo)
methods.Should().ContainSingle();
}

[TestCase(typeof(Amount))]
[TestCase(typeof(Money))]
[TestCase(typeof(StreamSize))]
public void Plus(Type svo)
Expand All @@ -52,7 +51,6 @@ public void Plus(Type svo)
operators.Should().ContainSingle();
}

[TestCase(typeof(Amount))]
[TestCase(typeof(Money))]
[TestCase(typeof(StreamSize))]
public void Negate(Type svo)
Expand All @@ -79,7 +77,6 @@ public void Negate(Type svo)
operators.Should().ContainSingle();
}

[TestCase(typeof(Amount))]
[TestCase(typeof(Money))]
[TestCase(typeof(StreamSize))]
public void Increment(Type svo)
Expand All @@ -106,7 +103,6 @@ public void Increment(Type svo)
operators.Should().ContainSingle();
}

[TestCase(typeof(Amount))]
[TestCase(typeof(Money))]
[TestCase(typeof(StreamSize))]
public void Decrement(Type svo)
Expand All @@ -133,7 +129,6 @@ public void Decrement(Type svo)
operators.Should().ContainSingle();
}

[TestCase(typeof(Amount), typeof(Amount), typeof(Percentage))]
[TestCase(typeof(Money), typeof(Money), typeof(Percentage))]
[TestCase(typeof(StreamSize), typeof(StreamSize), typeof(Percentage))]
public void Add(Type svo, params Type[] expected)
Expand Down Expand Up @@ -162,7 +157,6 @@ public void Add(Type svo, params Type[] expected)
operators.Should().BeEquivalentTo(expected);
}

[TestCase(typeof(Amount), typeof(Amount), typeof(Percentage))]
[TestCase(typeof(Money), typeof(Money), typeof(Percentage))]
[TestCase(typeof(StreamSize), typeof(StreamSize), typeof(Percentage))]
public void Subtract(Type svo, params Type[] expected)
Expand Down Expand Up @@ -191,7 +185,6 @@ public void Subtract(Type svo, params Type[] expected)
operators.Should().BeEquivalentTo(expected);
}

[TestCase(typeof(Amount), typeof(short), typeof(int), typeof(long), typeof(ushort), typeof(uint), typeof(ulong), typeof(float), typeof(double), typeof(decimal), typeof(Percentage))]
[TestCase(typeof(Money), typeof(short), typeof(int), typeof(long), typeof(ushort), typeof(uint), typeof(ulong), typeof(float), typeof(double), typeof(decimal), typeof(Percentage))]
[TestCase(typeof(StreamSize), typeof(short), typeof(int), typeof(long), typeof(ushort), typeof(uint), typeof(ulong), typeof(float), typeof(double), typeof(decimal), typeof(Percentage))]
public void Multiply(Type svo, params Type[] expected)
Expand Down Expand Up @@ -220,7 +213,6 @@ public void Multiply(Type svo, params Type[] expected)
operators.Should().BeEquivalentTo(expected);
}

[TestCase(typeof(Amount), typeof(short), typeof(int), typeof(long), typeof(ushort), typeof(uint), typeof(ulong), typeof(float), typeof(double), typeof(decimal), typeof(Percentage))]
[TestCase(typeof(Money), typeof(short), typeof(int), typeof(long), typeof(ushort), typeof(uint), typeof(ulong), typeof(float), typeof(double), typeof(decimal), typeof(Percentage))]
[TestCase(typeof(StreamSize), typeof(short), typeof(int), typeof(long), typeof(ushort), typeof(uint), typeof(ulong), typeof(float), typeof(double), typeof(decimal), typeof(Percentage))]
public void Divide(Type svo, params Type[] expected)
Expand Down Expand Up @@ -249,7 +241,6 @@ public void Divide(Type svo, params Type[] expected)
operators.Should().BeEquivalentTo(expected);
}

[TestCase(typeof(Amount))]
[TestCase(typeof(Money))]
[TestCase(typeof(Percentage))]
public void Round(Type svo)
Expand All @@ -265,7 +256,6 @@ public void Round(Type svo)
methods.Should().ContainSingle();
}

[TestCase(typeof(Amount))]
[TestCase(typeof(Money))]
[TestCase(typeof(Percentage))]
public void Round_Decimals(Type svo)
Expand All @@ -281,7 +271,6 @@ public void Round_Decimals(Type svo)
methods.Should().ContainSingle();
}

[TestCase(typeof(Amount))]
[TestCase(typeof(Money))]
[TestCase(typeof(Percentage))]
public void Round_Decimals_DecimalRounding(Type svo)
Expand Down

0 comments on commit 7340155

Please sign in to comment.