Skip to content

Commit

Permalink
Make file names match the examples
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnEffo committed Jun 18, 2023
1 parent 71dfc6e commit 1284400
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,20 @@

namespace csharp_attribute_based_parameters_comparision;

public class Int32Range : ParameterGeneraterBaseType<int>
public class Negative : ParameterGeneraterBaseType<int>
{
private readonly int _min;
private readonly int _max;

public Int32Range(int min, int max)
{
_min = min;
_max = max;
}
public override Gen<int> Generator => Gen.Int32(Range.Constant(_min, _max));
public override Gen<int> Generator => Gen.Int32(Range.Constant(Int32.MinValue, -1));
}
public class Positive : ParameterGeneraterBaseType<int>
{
public override Gen<int> 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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,24 @@

namespace csharp_attribute_based_parameters_comparision;

public class Negative : ParameterGeneraterBaseType<int>
public class Int32Range : ParameterGeneraterBaseType<int>
{
public override Gen<int> Generator => Gen.Int32(Range.Constant(Int32.MinValue, -1));
}
public class Positive : ParameterGeneraterBaseType<int>
{
public override Gen<int> 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<int> 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;
}

0 comments on commit 1284400

Please sign in to comment.