From 2d27e40b2222bec4c7db61fea3e92470f1080e37 Mon Sep 17 00:00:00 2001 From: Corniel Nobel Date: Sun, 21 Jan 2024 21:18:08 +0100 Subject: [PATCH] Drop specs that are not longer relevant. --- specs/Qowaiv.Specs/Percentage_specs.cs | 10 ++++++++++ specs/Qowaiv.Specs/Svo_numeric_contract_specs.cs | 8 -------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/specs/Qowaiv.Specs/Percentage_specs.cs b/specs/Qowaiv.Specs/Percentage_specs.cs index 4a1b3558..38d5146b 100644 --- a/specs/Qowaiv.Specs/Percentage_specs.cs +++ b/specs/Qowaiv.Specs/Percentage_specs.cs @@ -169,6 +169,16 @@ public void with_TryParse_returns_SVO() } } +public class Can_not_be_parsed +{ + [TestCase(NumberStyles.HexNumber)] + [TestCase(NumberStyles.AllowExponent)] + public void using_a_number_style_other_then_Number(NumberStyles style) + => style.Invoking(s => Percentage.TryParse("4.5%", s, CultureInfo.InvariantCulture, out _)) + .Should().Throw() + .WithMessage("The number style '*' is not supported.*"); +} + public class Can_be_created_with_percentage_extension { [Test] diff --git a/specs/Qowaiv.Specs/Svo_numeric_contract_specs.cs b/specs/Qowaiv.Specs/Svo_numeric_contract_specs.cs index 473e4bab..2ee793b9 100644 --- a/specs/Qowaiv.Specs/Svo_numeric_contract_specs.cs +++ b/specs/Qowaiv.Specs/Svo_numeric_contract_specs.cs @@ -27,7 +27,6 @@ public void Abs(Type svo) [TestCase(typeof(Amount))] [TestCase(typeof(Money))] - [TestCase(typeof(Percentage))] [TestCase(typeof(StreamSize))] public void Plus(Type svo) { @@ -55,7 +54,6 @@ public void Plus(Type svo) [TestCase(typeof(Amount))] [TestCase(typeof(Money))] - [TestCase(typeof(Percentage))] [TestCase(typeof(StreamSize))] public void Negate(Type svo) { @@ -83,7 +81,6 @@ public void Negate(Type svo) [TestCase(typeof(Amount))] [TestCase(typeof(Money))] - [TestCase(typeof(Percentage))] [TestCase(typeof(StreamSize))] public void Increment(Type svo) { @@ -111,7 +108,6 @@ public void Increment(Type svo) [TestCase(typeof(Amount))] [TestCase(typeof(Money))] - [TestCase(typeof(Percentage))] [TestCase(typeof(StreamSize))] public void Decrement(Type svo) { @@ -139,7 +135,6 @@ public void Decrement(Type svo) [TestCase(typeof(Amount), typeof(Amount), typeof(Percentage))] [TestCase(typeof(Money), typeof(Money), typeof(Percentage))] - [TestCase(typeof(Percentage), typeof(Percentage))] [TestCase(typeof(StreamSize), typeof(StreamSize), typeof(Percentage))] public void Add(Type svo, params Type[] expected) { @@ -169,7 +164,6 @@ public void Add(Type svo, params Type[] expected) [TestCase(typeof(Amount), typeof(Amount), typeof(Percentage))] [TestCase(typeof(Money), typeof(Money), typeof(Percentage))] - [TestCase(typeof(Percentage), typeof(Percentage))] [TestCase(typeof(StreamSize), typeof(StreamSize), typeof(Percentage))] public void Subtract(Type svo, params Type[] expected) { @@ -199,7 +193,6 @@ public void Subtract(Type svo, params Type[] 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(Percentage), 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) { @@ -229,7 +222,6 @@ public void Multiply(Type svo, params Type[] 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(Percentage), 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) {