tests/Kingdom.OrTools.Sat.Parameters.Tests/OrToolsSatParametersTests.cs
/// <summary>
/// Verifies that the <paramref name="parameterType"/> Constructor Given
/// <paramref name="argumentTypes"/> and <paramref name="args"/> themselves
/// functions properly. That is, that we properly identify the corresponding
/// <see cref="ConstructorInfo"/> and that it yields a valid <see cref="IParameter"/>
/// instance.
/// </summary>
/// <param name="parameterType"></param>
/// <param name="argumentTypes"></param>
/// <param name="args"></param>
Verifies that the  Constructor Given
and  themselves
functions properly. That is, that we properly identify the corresponding
and that it yields a valid
instance.
Verifies that the Constructor Given and themselves functions properly . That is that we properly identify the corresponding and that it yields a valid instance .
[Theory, MemberData(nameof(ParameterCreationTestCases))]
        public void Given_Parameters_Ctor_Works(Type parameterType, Type[] argumentTypes, object[] args)
        {
            var ctor = parameterType.GetConstructor(argumentTypes).AssertNotNull();
            args = args.AssertNotNull();
            var instance = ctor.Invoke(args).AssertNotNull().AssertIsAssignableFrom<IParameter>();
            instance.AssertIsType(parameterType);
        }
[ Theory , MemberData ( nameof ( ParameterCreationTestCases ) ) ] public void Given_Parameters_Ctor_Works ( Type parameterType , Type [ ] argumentTypes , object [ ] args ) { var ctor = parameterType . GetConstructor ( argumentTypes ) . AssertNotNull ( ) ; args = args . AssertNotNull ( ) ; var instance = ctor . Invoke ( args ) . AssertNotNull ( ) . AssertIsAssignableFrom < IParameter > ( ) ; instance . AssertIsType ( parameterType ) ; }
Verifies that the  Constructor Given
and  themselves
functions properly.
Verifies that the Constructor Given and themselves functions properly .
/* TODO: TBD: So far so good, but the DefaultRestartAlgorithmsRepeatedParameter repeated RestartAlgorithm parameter is proving a bit difficult...
             1. cannot directly use the types emitted, even though they are there.
             2. the DefaultRestartAlgorithmsRepeatedParameter type in particular is a corner case in its present form, required first parameter, optional set of params values thereafter...
             3. may consider a default ctor, or at least a single value ctor...
             4. at the same time introduce a third ctor taking IEnumerable<RestartAlgorithm> values...
             5. then if there are any differences we can isolate those test cases downstream...
             6a. might also consider how better to `publish´ the Kingdom.OrTools.Sat.Core assembly...
             6b. ...as a direct ProjectReference? ...or as yet another internally delivered PackageReference? */ // TODO: TBD: SO! ... with all the above considerations... // TODO: TBD: we have a satisfactory workaround to the immediate issue... // TODO: TBD: notwithstanding cleaning some code up... // TODO: TBD: might consider receiving only the args, and inferring the types out... // TODO: TBD: should also reflect the Ctor out in the body of the test, since the idea is we can to verify the ctor during the test... // TODO: TBD: IOW, we are not there to receive a ctor, but to verify we can find it successfully, invoke it, etc, with the expected `args´.

parameterType
Type
None
argumentTypes
Type[]
None
args
object[]
None