Part of #64.
Dependencies
Implement
File: src/Conjecture.Core/StrategyExtensions.cs — append C# 14 extension blocks:
extension(Strategy<int> s)
{
public Strategy<int> Positive => s.Where(x => x > 0);
public Strategy<int> Negative => s.Where(x => x < 0);
public Strategy<int> NonZero => s.Where(x => x != 0);
}
extension(Strategy<string> s)
{
public Strategy<string> NonEmpty => s.Where(x => x.Length > 0);
}
extension(Strategy<IList<T>> s)
{
public Strategy<IList<T>> NonEmpty => s.Where(x => x.Count > 0);
}
Add XML doc comments to each property noting the filter-budget caveat: for tight value ranges, prefer a targeted strategy (e.g. Generate.Integers(1, 100)) over chaining .Where().
Update src/Conjecture.Core/PublicAPI.Unshipped.txt with the new public symbols.
Test
File: src/Conjecture.Core.Tests/StrategyExtensionsTests.cs — new test class ExtensionPropertyTests:
Positive_ReturnsOnlyPositiveIntegers
Negative_ReturnsOnlyNegativeIntegers
NonZero_NeverReturnsZero
String_NonEmpty_NeverReturnsEmptyString
List_NonEmpty_NeverReturnsEmptyList
ExtensionProperties_ComposeWithSelectAndZip — verify chaining with other combinators works
Part of #64.
Dependencies
Implement
File:
src/Conjecture.Core/StrategyExtensions.cs— append C# 14extensionblocks:Add XML doc comments to each property noting the filter-budget caveat: for tight value ranges, prefer a targeted strategy (e.g.
Generate.Integers(1, 100)) over chaining.Where().Update
src/Conjecture.Core/PublicAPI.Unshipped.txtwith the new public symbols.Test
File:
src/Conjecture.Core.Tests/StrategyExtensionsTests.cs— new test classExtensionPropertyTests:Positive_ReturnsOnlyPositiveIntegersNegative_ReturnsOnlyNegativeIntegersNonZero_NeverReturnsZeroString_NonEmpty_NeverReturnsEmptyStringList_NonEmpty_NeverReturnsEmptyListExtensionProperties_ComposeWithSelectAndZip— verify chaining with other combinators works