Пример #1
0
        public void Compare_WithNullScenarios_Throws(PerformanceComparer <TSeed, TResult> sut)
        {
            // Fixture setup
            IFixture fixture = DomainFixture.CreateFor(this);
            IReadOnlyList <PerformanceScenario <TSeed, TResult> > scenarios = null;
            CancellationToken cancellationToken     = fixture.Create <CancellationToken>();
            IProgress <ProgressPercentage> progress = fixture.Create <IProgress <ProgressPercentage> >();

            // Exercise system
            // Verify outcome
            Assert.Throws <ArgumentNullException>(nameof(scenarios), () =>
            {
                sut.Compare(scenarios, cancellationToken, progress);
            });

            // Teardown
        }
Пример #2
0
        public void Compare_WithNullScenario_Throws(PerformanceComparer <TSeed, TResult> sut, PerformanceScenario <TSeed, TResult>[] scenarios)
        {
            // Fixture setup
            IFixture fixture   = DomainFixture.CreateFor(this);
            int      nullIndex = fixture.Create <int>() % scenarios.Length;

            scenarios[nullIndex] = null;
            CancellationToken cancellationToken     = fixture.Create <CancellationToken>();
            IProgress <ProgressPercentage> progress = fixture.Create <IProgress <ProgressPercentage> >();

            // Exercise system
            // Verify outcome
            Assert.Throws <ArgumentException>(nameof(scenarios), () =>
            {
                sut.Compare(scenarios, cancellationToken, progress);
            });

            // Teardown
        }