src/Kingdom.OrTools.Sat.Parameters.Tests/ParameterTestFixtureBase.cs
// TODO: TBD: could potentially see this refactored into a more general library / API at some point...
// ReSharper disable once CommentTypo
// TODO: TBD: Perhaps the Collections libraries? Or even Combinatorics?
/// <summary>
/// This is not necessarily a Parameters test, apart from the Slicing strategy
/// being borne out of the effort.
/// </summary>
This is not necessarily a Parameters test, apart from the Slicing strategy
being borne out of the effort.
This is not necessarily a Parameters test apart from the Slicing strategy being borne out of the effort .
[Fact]
        public void Try_Slicing_Descriptor_Subsets()
        {
            var original = ParameterTestCasesBase.Descriptors.AssertNotNull().AssertNotEmpty().ToArray();
            IEnumerable<TestCaseDescriptor> descriptors = original.ToArray();
            var slices = new List<IEnumerable<TestCaseDescriptor>> { };
            while (descriptors.TrySliceOverCollection(7, out var slice, out descriptors))
            {
                slices.Add(slice);
            }
            slices.AssertNotEmpty().AssertEqual(original.Length, x => x.Sum(y => y.Count()));
            slices.SelectMany(x => x.Select(y => y.Id)).OrderBy(y => y).AssertEqual(original.Select(y => y.Id).OrderBy(y => y));
        }
[ Fact ] public void Try_Slicing_Descriptor_Subsets ( ) { var original = ParameterTestCasesBase . Descriptors . AssertNotNull ( ) . AssertNotEmpty ( ) . ToArray ( ) ; IEnumerable < TestCaseDescriptor > descriptors = original . ToArray ( ) ; var slices = new List < IEnumerable < TestCaseDescriptor > > { } ; while ( descriptors . TrySliceOverCollection ( 7 , out var slice , out descriptors ) ) { slices . Add ( slice ) ; } slices . AssertNotEmpty ( ) . AssertEqual ( original . Length , x => x . Sum ( y => y . Count ( ) ) ) ; slices . SelectMany ( x => x . Select ( y => y . Id ) ) . OrderBy ( y => y ) . AssertEqual ( original . Select ( y => y . Id ) . OrderBy ( y => y ) ) ; }
This is not necessarily a Parameters test, apart from the Slicing strategy
being borne out of the effort.
This is not necessarily a Parameters test apart from the Slicing strategy being borne out of the effort .
// ReSharper disable once RedundantEmptyObjectOrCollectionInitializer // Permutations are definitely overkill, this is perfectly adequate. // We should have All of the Original Elements accounted for. // Which we may further verify in actual.