public TestDescriptor(string name, TestTypeInfo[] controllers, IErrorDescriptor[] errors, params BindingTest[] bindingTree)
 {
     Name = name;
     Controllers = controllers;
     Errors = errors ?? new IErrorDescriptor[0];
     BindingTree = bindingTree;
 }
 public TestDescriptor(string name, TestTypeInfo[] controllers, UrlControllersTest[] urlTests)
 {
     Name = name;
     Controllers = controllers;
     //Errors = errors ?? new IErrorDescriptor[0];
     UrlTests = urlTests ?? new UrlControllersTest[0];
     //BindingTree = bindingTree;
 }
Ejemplo n.º 3
0
        public void ImplementsInterface_ThrowsIfPassedInParameterIsNotRuntimeTypeOrCodeAnalysisBasedTypeInfo()
        {
            // Arrange
            var interfaceType     = new TestTypeInfo();
            var compilation       = CompilationUtility.GetCompilation(nameof(DerivingFromList));
            var tagHelperResolver = new PrecompilationTagHelperTypeResolver(compilation);

            // Act
            var exportedTypes = tagHelperResolver.GetExportedTypes(compilation.AssemblyName);

            // Assert
            var actual = Assert.Single(exportedTypes);

            ExceptionAssert.ThrowsArgument(() => actual.ImplementsInterface(interfaceType),
                                           "interfaceTypeInfo",
                                           $"Argument must be an instance of '{typeof(RuntimeTypeInfo)}' or '{typeof(CodeAnalysisSymbolBasedTypeInfo)}'.");
        }
 private TestTypeInfo Type(string type, TestTypeInfo.TestAttributeInfo[] attributes, TestTypeInfo.TestFieldInfo[] fields, params TestTypeInfo.TestPropertyInfo[] properties)
 {
     return new TestTypeInfo(type, attributes, fields, properties);
 }
 private void NewTestWithUrl(string name, TestTypeInfo[] types, params UrlControllersTest[] urlTests)//, IErrorDescriptor[] errors, params BindingTest[] nodes)
 {
     tests.Add(new TestDescriptor(name, types, urlTests));
 }
Ejemplo n.º 6
0
 private void NewErrorTest(string name, TestTypeInfo[] types, IErrorDescriptor[] errors, params BindingTest[] nodes)
 {
     tests.Add(new TestDescriptor(name, types, errors, nodes));
 }
Ejemplo n.º 7
0
 private void NewTest(string name, TestTypeInfo[] types, params BindingTest[] nodes)
 {
     tests.Add(new TestDescriptor(name, types, null, nodes));
 }