コード例 #1
0
 public void TestBuildGenericWithThreeArguments()
 {
     var types = GenericBenchmarksBuilder.GetRunnableBenchmarks(new [] {typeof(ThreeArgGenericBenchmark<,,>)});
     
     Assert.Equal(2, types.Length);
     Assert.Single(types, typeof(ThreeArgGenericBenchmark<int, char, string>));
     Assert.Single(types, typeof(ThreeArgGenericBenchmark<char, string, byte>));
 }
コード例 #2
0
        public void TestBuildGenericWithConstraints()
        {
            var types = GenericBenchmarksBuilder.GetRunnableBenchmarks(new[] { typeof(GenericBenchmarkWithConstraints <,>) });

            Assert.Equal(2, types.Length);
            Assert.Single(types, typeof(GenericBenchmarkWithConstraints <int, char>));
            Assert.Single(types, typeof(GenericBenchmarkWithConstraints <char, byte>));
        }
コード例 #3
0
 public void TestBuildGenericWithOneArgument()
 {
     var types = GenericBenchmarksBuilder.GetRunnableBenchmarks(new [] {typeof(OneArgGenericBenchmark<>)});
     
     Assert.Equal(2, types.Length);
     Assert.Single(types, typeof(OneArgGenericBenchmark<int>));
     Assert.Single(types, typeof(OneArgGenericBenchmark<char>));
 }
コード例 #4
0
        public void TestBuildGenericWithWrongAttributes()
        {
            var types = GenericBenchmarksBuilder.GetRunnableBenchmarks(new[] { typeof(GenericBenchmarkWithWrongAttribute <,>) });

            Assert.Equal(2, types.Length);
            Assert.Single(types, typeof(GenericBenchmarkWithWrongAttribute <int, char>));
            Assert.Single(types, typeof(GenericBenchmarkWithWrongAttribute <char, string>));
        }