예제 #1
0
        public void ProcessorAffinityIsPrintedAsBitMaskEvenWhenNotSet()
        {
            var jobWithoutAffinity = Job.Default;

            var benchmarkCase = BenchmarkConverter.TypeToBenchmarks(
                typeof(CharacteristicPresenterTests),
                DefaultConfig.Instance.With(jobWithoutAffinity)).BenchmarksCases.Single();

            var column = new JobCharacteristicColumn(EnvironmentMode.AffinityCharacteristic);

            var expected = Convert.ToString((int)RuntimeInformation.GetCurrentAffinity(), 2).PadLeft(Environment.ProcessorCount, '1');

            var printed = column.GetValue(summary: null, benchmarkCase);

            Assert.Equal(expected, printed);
        }