Пример #1
0
 public void GenericTypeWithFullNamespace()
 {
     ParseUtilCSharp.AssertDocumentationReference(
         "System.Collections.Generic.List{T}",
         new DocumentationReference {
         DeclaringType = new SimpleType("System").MemberType("Collections").MemberType("Generic"),
         MemberName    = "List",
         TypeArguments = { new SimpleType("T") }
     });
 }
Пример #2
0
 public void OperatorPlusWithDeclaringType()
 {
     ParseUtilCSharp.AssertDocumentationReference(
         "Test.operator +",
         new DocumentationReference {
         DeclaringType = new SimpleType("Test"),
         EntityType    = EntityType.Operator,
         OperatorType  = OperatorType.Addition
     });
 }
Пример #3
0
 public void ImplicitOperator()
 {
     ParseUtilCSharp.AssertDocumentationReference(
         "implicit operator int",
         new DocumentationReference {
         EntityType   = EntityType.Operator,
         OperatorType = OperatorType.Implicit,
         ConversionOperatorReturnType = new PrimitiveType("int")
     });
 }
 public void NestedTypeInGenericType()
 {
     ParseUtilCSharp.AssertDocumentationReference(
         "List{T}.Enumerator",
         new DocumentationReference
     {
         DeclaringType = new SimpleType("List", new SimpleType("T")),
         MemberName    = "Enumerator"
     });
 }
Пример #5
0
 public void GenericMethodInGeneric()
 {
     ParseUtilCSharp.AssertDocumentationReference(
         "IGeneric{X, Y}.Test{Z}",
         new DocumentationReference {
         DeclaringType = new SimpleType("IGeneric", new SimpleType("X"), new SimpleType("Y")),
         MemberName    = "Test",
         TypeArguments = { new SimpleType("Z") }
     });
 }
 public void ThisWithDeclaringType()
 {
     ParseUtilCSharp.AssertDocumentationReference(
         "List{T}.this",
         new DocumentationReference
     {
         EntityType    = EntityType.Indexer,
         DeclaringType = new SimpleType("List", new SimpleType("T"))
     });
 }
 public void OperatorPlus()
 {
     ParseUtilCSharp.AssertDocumentationReference(
         "operator +",
         new DocumentationReference
     {
         EntityType   = EntityType.Operator,
         OperatorType = OperatorType.Addition
     });
 }
 public void EmptyParameterList()
 {
     ParseUtilCSharp.AssertDocumentationReference(
         "Window1()",
         new DocumentationReference
     {
         MemberName       = "Window1",
         HasParameterList = true
     });
 }
 public void MixedGeneric()
 {
     ParseUtilCSharp.AssertDocumentationReference(
         "IGeneric<X, Y}",
         new DocumentationReference
     {
         MemberName    = "IGeneric",
         TypeArguments = { new SimpleType("X"), new SimpleType("Y") }
     });
 }
 public void PrimitiveType()
 {
     ParseUtilCSharp.AssertDocumentationReference(
         "int",
         new DocumentationReference
     {
         EntityType    = EntityType.TypeDefinition,
         DeclaringType = new PrimitiveType("int")
     });
 }
Пример #11
0
 public void ThisWithParameter()
 {
     ParseUtilCSharp.AssertDocumentationReference(
         "this[int]",
         new DocumentationReference {
         SymbolKind       = SymbolKind.Indexer,
         HasParameterList = true,
         Parameters       = { new ParameterDeclaration {
                                  Type = new PrimitiveType("int")
                              } }
     });
 }
Пример #12
0
 public void IntParse()
 {
     ParseUtilCSharp.AssertDocumentationReference(
         "int.Parse(string)",
         new DocumentationReference {
         DeclaringType    = new PrimitiveType("int"),
         MemberName       = "Parse",
         HasParameterList = true,
         Parameters       =
         {
             new ParameterDeclaration {
                 Type = new PrimitiveType("string")
             }
         }
     });
 }
Пример #13
0
 public void ExplicitOperatorWithParameterList()
 {
     ParseUtilCSharp.AssertDocumentationReference(
         "explicit operator int(Test)",
         new DocumentationReference {
         SymbolKind   = SymbolKind.Operator,
         OperatorType = OperatorType.Explicit,
         ConversionOperatorReturnType = new PrimitiveType("int"),
         HasParameterList             = true,
         Parameters =
         {
             new ParameterDeclaration {
                 Type = new SimpleType("Test")
             },
         }
     });
 }
Пример #14
0
 public void GenericMethodInGenericWithParameterList()
 {
     ParseUtilCSharp.AssertDocumentationReference(
         "IGeneric{X, Y}.Test{Z}(ref Z[,])",
         new DocumentationReference {
         DeclaringType    = new SimpleType("IGeneric", new SimpleType("X"), new SimpleType("Y")),
         MemberName       = "Test",
         TypeArguments    = { new SimpleType("Z") },
         HasParameterList = true,
         Parameters       =
         {
             new ParameterDeclaration {
                 ParameterModifier = ParameterModifier.Ref,
                 Type = new SimpleType("Z").MakeArrayType(2)
             }
         }
     });
 }
Пример #15
0
 public void OperatorPlusWithParameterList()
 {
     ParseUtilCSharp.AssertDocumentationReference(
         "operator +(Test, int)",
         new DocumentationReference {
         SymbolKind       = SymbolKind.Operator,
         OperatorType     = OperatorType.Addition,
         HasParameterList = true,
         Parameters       =
         {
             new ParameterDeclaration {
                 Type = new SimpleType("Test")
             },
             new ParameterDeclaration {
                 Type = new PrimitiveType("int")
             }
         }
     });
 }