Пример #1
0
        public void OptimizerCombinators_ArgumentChecks()
        {
            AssertEx.ThrowsException <ArgumentNullException>(() => Optimizer.Then(first: null, Optimizer.Nop()), AssertParameterName("first"));
            AssertEx.ThrowsException <ArgumentNullException>(() => Optimizer.Nop().Then(second: null), AssertParameterName("second"));

            AssertEx.ThrowsException <ArgumentNullException>(() => Optimizer.FixedPoint(optimizer: null), AssertParameterName("optimizer"));

            AssertEx.ThrowsException <ArgumentNullException>(() => Optimizer.FixedPoint(optimizer: null, throwOnCycle: true), AssertParameterName("optimizer"));

            AssertEx.ThrowsException <ArgumentNullException>(() => Optimizer.FixedPoint(optimizer: null, throwOnCycle: true, maxIterations: 0), AssertParameterName("optimizer"));
            AssertEx.ThrowsException <ArgumentOutOfRangeException>(() => Optimizer.Nop().FixedPoint(throwOnCycle: true, maxIterations: -1), AssertParameterName("maxIterations"));
        }