From 12844005e66a4da38f861d4ec83f30a74762f35b Mon Sep 17 00:00:00 2001 From: John Efford Date: Sun, 18 Jun 2023 12:22:20 +0100 Subject: [PATCH] Make file names match the examples --- .../PositiveAndNegativeSimpleAttribute.cs | 22 ++++++++----------- ...dNegativeUtilizingIntegerRangeAttribute.cs | 22 +++++++++++-------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/examples/csharp-attribute-based-parameters-comparision/PositiveAndNegativeSimpleAttribute.cs b/examples/csharp-attribute-based-parameters-comparision/PositiveAndNegativeSimpleAttribute.cs index 8b4054b..87d2b25 100644 --- a/examples/csharp-attribute-based-parameters-comparision/PositiveAndNegativeSimpleAttribute.cs +++ b/examples/csharp-attribute-based-parameters-comparision/PositiveAndNegativeSimpleAttribute.cs @@ -5,24 +5,20 @@ namespace csharp_attribute_based_parameters_comparision; -public class Int32Range : ParameterGeneraterBaseType +public class Negative : ParameterGeneraterBaseType { - private readonly int _min; - private readonly int _max; - - public Int32Range(int min, int max) - { - _min = min; - _max = max; - } - public override Gen Generator => Gen.Int32(Range.Constant(_min, _max)); + public override Gen Generator => Gen.Int32(Range.Constant(Int32.MinValue, -1)); +} +public class Positive : ParameterGeneraterBaseType +{ + public override Gen Generator => Gen.Int32(Range.Constant(1, Int32.MaxValue)); } -public class PositiveAndNegativeWithAttributes +public class PositiveAndNegativeUtilizingIntegerRangeAttribute { [Property] public bool ResultOfAddingPositiveAndNegativeLessThanPositive( - [Int32Range(1, Int32.MaxValue)] int positive, - [Int32Range(Int32.MinValue, -1 )] int negative) + [Positive] int positive, + [Negative] int negative) => positive + negative < positive; } diff --git a/examples/csharp-attribute-based-parameters-comparision/PositiveAndNegativeUtilizingIntegerRangeAttribute.cs b/examples/csharp-attribute-based-parameters-comparision/PositiveAndNegativeUtilizingIntegerRangeAttribute.cs index 87d2b25..8b4054b 100644 --- a/examples/csharp-attribute-based-parameters-comparision/PositiveAndNegativeUtilizingIntegerRangeAttribute.cs +++ b/examples/csharp-attribute-based-parameters-comparision/PositiveAndNegativeUtilizingIntegerRangeAttribute.cs @@ -5,20 +5,24 @@ namespace csharp_attribute_based_parameters_comparision; -public class Negative : ParameterGeneraterBaseType +public class Int32Range : ParameterGeneraterBaseType { - public override Gen Generator => Gen.Int32(Range.Constant(Int32.MinValue, -1)); -} -public class Positive : ParameterGeneraterBaseType -{ - public override Gen Generator => Gen.Int32(Range.Constant(1, Int32.MaxValue)); + private readonly int _min; + private readonly int _max; + + public Int32Range(int min, int max) + { + _min = min; + _max = max; + } + public override Gen Generator => Gen.Int32(Range.Constant(_min, _max)); } -public class PositiveAndNegativeUtilizingIntegerRangeAttribute +public class PositiveAndNegativeWithAttributes { [Property] public bool ResultOfAddingPositiveAndNegativeLessThanPositive( - [Positive] int positive, - [Negative] int negative) + [Int32Range(1, Int32.MaxValue)] int positive, + [Int32Range(Int32.MinValue, -1 )] int negative) => positive + negative < positive; }