371 references to Value
Microsoft.CodeAnalysis (1)
Symbols\TypedConstant.cs (1)
91/// Unlike <see cref="Value"/> returns <see cref="ISymbolInternal"/> when the value is a symbol.
Microsoft.CodeAnalysis.CodeStyle (3)
AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
828attribute.ConstructorArguments is [_, { Kind: TypedConstantKind.Primitive, Value: string checkId }, ..]) 840Value: string categoryArg
AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
590attribute.ConstructorArguments is [{ Kind: TypedConstantKind.Primitive, Type.SpecialType: SpecialType.System_String, Value: string value }])
Microsoft.CodeAnalysis.CSharp (2)
Symbols\TypedConstantExtensions.cs (2)
32Debug.Assert(constant.Value is object); 33return "typeof(" + constant.Value.ToString() + ")";
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
ExpressionGenerator.cs (3)
31return GenerateExpression(generator, typedConstant.Type, typedConstant.Value, canUseFieldReference: true); 34return typedConstant.Value is ITypeSymbol 35? SyntaxFactory.TypeOfExpression(((ITypeSymbol)typedConstant.Value).GenerateTypeSyntax())
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (5)
CodeGen\CodeGenAsyncIteratorTests.cs (1)
860Assert.Equal("C.<M>d__0", ((ITypeSymbol)argument.Value).ToTestDisplayString());
CodeGen\CodeGenLocalFunctionTests.cs (3)
5292Assert.Equal(new object[] { 1, "hello" }, attrs[2].ConstructorArguments.Select(a => a.Value)); 5295Assert.Equal(new object[] { 1, 2, 3, 4, 5 }, attr3Args.Select(a => a.Value)); 5332Assert.Equal(42, arg.Value);
Emit\OptionalArgumentsTests.cs (1)
229Assert.Equal(expectedDefault, argument.Value);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (39)
Attributes\AttributeTests.cs (15)
656Assert.Equal(new object[] { 1, 2, 3 }, attributeData.ConstructorArguments.Select(arg => arg.Value)); 713Assert.Equal("M0", attrs.Single().ConstructorArguments.Single().Value); 1028Assert.Equal(true, arguments0[0].Value); 1029Assert.Equal(1, arguments0[1].Value); 1034Assert.Equal(true, arguments1[0].Value); 1035Assert.Equal(1, arguments1[1].Value); 1036Assert.Equal("a", arguments1[2].Values.Single().Value); 5461Assert.Throws<InvalidOperationException>(() => args[0].Value); 5465Assert.Throws<InvalidOperationException>(() => args[1].Value); 5471Assert.Throws<InvalidOperationException>(() => named["P"].Value); 5475Assert.Throws<InvalidOperationException>(() => named["F"].Value); 5503Assert.Null(args[0].Value); 5507Assert.Null(args[1].Value); 9615var typeInAttribute = (INamedTypeSymbol)type.GetAttributes()[0].ConstructorArguments.First().Value; 9625typeInAttribute = (INamedTypeSymbol)type.GetAttributes()[0].ConstructorArguments.First().Value;
Attributes\AttributeTests_CallerInfoAttributes.cs (14)
1946Assert.Equal("Hello", attributeArguments[0].Value); 1947Assert.Equal("\"Hello\"", attributeArguments[1].Value); 1978Assert.Equal("Hello", attributeArguments[0].Value); 1979Assert.Equal("\"Hello\"", attributeArguments[1].Value); 2010Assert.Equal("Hello", attributeArguments[0].Value); 2011Assert.Equal("World", attributeArguments[1].Value); 2012Assert.Equal("\"Hello\"", attributeArguments[2].Value); 2043Assert.Equal("Hello", attributeArguments[0].Value); 2044Assert.Equal("World", attributeArguments[1].Value); 2045Assert.Equal("\"Hello\"", attributeArguments[2].Value); 2301Assert.Equal(3, arguments[0].Value); 2302Assert.Equal(0, arguments[1].Value); 4397Assert.Equal(1, attr.CommonConstructorArguments[0].Value); 4427Assert.Equal(1, attr.CommonConstructorArguments[0].Value);
Attributes\AttributeTests_Dynamic.cs (3)
552Assert.Equal(expectedTransformFlags[i], (bool)actualTransformFlag.Value); 1107Assert.Equal(false, values[0].Value); 1108Assert.Equal(true, values[1].Value);
Attributes\AttributeTests_IsByRefLike.cs (3)
676Assert.Equal("hello", attribute.ConstructorArguments.ElementAt(0).Value); 677Assert.Equal(true, attribute.ConstructorArguments.ElementAt(1).Value); 761Assert.Equal(42u, attribute.ConstructorArguments.ElementAt(2).Value);
Attributes\AttributeTests_Synthesized.cs (2)
195Assert.Equal(DebuggerBrowsableState.Never, (DebuggerBrowsableState)attributes[1].ConstructorArguments.Single().Value); 406return (string)dd.ConstructorArguments.Single().Value;
Attributes\AttributeTests_Tuples.cs (1)
648return (string)constant.Value;
Attributes\AttributeTests_WellKnownAttributes.cs (1)
198Assert.Equal(TypeLibFuncFlags.FDefaultBind, (TypeLibFuncFlags)attrSym.CommonConstructorArguments[0].Value);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (8)
Semantics\BindingTests.cs (3)
2572Assert.Equal((int)i.Value, (int)t.ConstantValue); 2602Assert.Equal((int)i.Value, (int)t.ConstantValue); 2632Assert.Equal((int)i.Value, (int)t.ConstantValue);
Semantics\LocalFunctionTests.cs (1)
559Assert.Equal(42, attributeData.ConstructorArguments.Single().Value);
Semantics\MultiDimensionalArrayTests.cs (4)
1681var a1 = (IArrayTypeSymbol)p.GetMember<MethodSymbol>("Test1").GetAttributes().Single().ConstructorArguments.Single().Value; 1686var a2 = (IArrayTypeSymbol)p.GetMember<MethodSymbol>("Test2").GetAttributes().Single().ConstructorArguments.Single().Value; 1691Assert.True(((ITypeSymbol)p.GetMember<MethodSymbol>("Test3").GetAttributes().Single().ConstructorArguments.Single().Value).IsErrorType()); 1692Assert.True(((ITypeSymbol)p.GetMember<MethodSymbol>("Test4").GetAttributes().Single().ConstructorArguments.Single().Value).IsErrorType());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (37)
Compilation\SemanticModelAPITests.cs (1)
4454Assert.Equal("DEBUG", attribute.ConstructorArguments[0].Value);
Symbols\AnonymousTypesSymbolTests.cs (1)
1161actual[index].CommonConstructorArguments[argIndex].Value.ToString()
Symbols\Metadata\PE\LoadingAttributes.cs (27)
389Assert.Equal("Integer", attr.CommonConstructorArguments.Single().Value); 395Assert.Equal("Integer", attr.CommonConstructorArguments.Single().Value); 551CheckConstructorArg(expected[i].Pos[j], pa.Value.ToString()); 573Assert.Equal(expected.Value, actual.Value.Value.ToString()); 627Assert.Equal(2, a.CommonConstructorArguments[0].Value); 701Assert.Equal(typeof(Int32), attrSym.CommonConstructorArguments[0].Value.GetType()); 702Assert.Equal(1, attrSym.CommonConstructorArguments[0].Value); 719Assert.Equal(32, attrSym.CommonConstructorArguments[0].Value); 752Assert.Equal(3, attrSym.CommonConstructorArguments[0].Value); 756Assert.Equal(true, attrSym.CommonNamedArguments[0].Value.Value); 989Assert.Equal("555", attrSym.CommonConstructorArguments[0].Value); 997Assert.Equal("obj", attrSym.CommonConstructorArguments[0].Value); 998Assert.Equal(12, attrSym.CommonConstructorArguments[1].Value); 1008Assert.Equal("System.Collections.Generic.IList<>", (attrSym.CommonNamedArguments[0].Value.Value as INamedTypeSymbol).ToString()); 1119Assert.Equal(-1, prop.GetAttributes().First().CommonConstructorArguments[0].Value); 1137Assert.Equal(-8, attrSym.CommonConstructorArguments[0].Value); 1139Assert.Equal(Convert.ToByte(255), attrSym.CommonConstructorArguments[1].Value); 1149Assert.Equal(7, attrSym.CommonConstructorArguments[0].Value); 1151Assert.Equal(256L, attrSym.CommonConstructorArguments[1].Value); 1153Assert.Equal(0.123f, attrSym.CommonConstructorArguments[2].Value); 1154Assert.Equal(Convert.ToInt16(-2), attrSym.CommonConstructorArguments[3].Value); 1162Assert.Equal("AttributeUse.IFoo<System.Int16, System.UInt16>", (attrSym.CommonConstructorArguments[0].Value as INamedTypeSymbol).ToDisplayString(SymbolDisplayFormat.TestFormat)); 1163Assert.Equal(1, attrSym.CommonNamedArguments[0].Value.Value); 1211Assert.Equal("System.Linq.Expressions.Expression.BinaryExpressionProxy", ((ITypeSymbol)attr1.CommonConstructorArguments[0].Value).ToDisplayString(SymbolDisplayFormat.TestFormat)); 1216Assert.Equal("System.Linq.Expressions.Expression.TypeBinaryExpressionProxy", ((ITypeSymbol)attr1.CommonConstructorArguments[0].Value).ToDisplayString(SymbolDisplayFormat.TestFormat)); 1246Assert.Equal(0, attr.CommonNamedArguments[0].Value.Value); 1283Assert.Equal(1, attr.CommonConstructorArguments[0].Value);
Symbols\Retargeting\RetargetCustomAttributes.cs (4)
308Assert.Throws<InvalidOperationException>(() => args[0].Value); 312Assert.Throws<InvalidOperationException>(() => args[1].Value); 318Assert.Throws<InvalidOperationException>(() => named["P"].Value); 322Assert.Throws<InvalidOperationException>(() => named["F"].Value);
Symbols\TypedConstantTests.cs (4)
48Assert.Equal(common.Value, lang.Value); 52Assert.Equal(common.Value, common2.Value);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (4)
Extensions.cs (3)
389return expected.Equals(arg.Value); 424return expected == null ? arg.Value == null : expected.Equals(arg.Value);
TestAttributesVisitor.cs (1)
197builder.Append(value.Value);
Microsoft.CodeAnalysis.CSharp.WinRT.UnitTests (2)
Metadata\WinMdDumpTest.cs (2)
311result.Append(constant.Value); 317var value = constant.Value;
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
ExpressionGenerator.cs (3)
31return GenerateExpression(generator, typedConstant.Type, typedConstant.Value, canUseFieldReference: true); 34return typedConstant.Value is ITypeSymbol 35? SyntaxFactory.TypeOfExpression(((ITypeSymbol)typedConstant.Value).GenerateTypeSyntax())
Microsoft.CodeAnalysis.Features (8)
AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (2)
828attribute.ConstructorArguments is [_, { Kind: TypedConstantKind.Primitive, Value: string checkId }, ..]) 840Value: string categoryArg
AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
590attribute.ConstructorArguments is [{ Kind: TypedConstantKind.Primitive, Type.SpecialType: SpecialType.System_String, Value: string value }])
DesignerAttribute\DesignerAttributeDiscoveryService.cs (1)
262if (attribute is { ConstructorArguments: [{ Type.SpecialType: SpecialType.System_String, Value: string stringValue }] })
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (3)
4765var layoutValue = attribute.ConstructorArguments.Single().Value; 6033_ => object.Equals(x.Value, y.Value)
EmbeddedLanguages\EmbeddedLanguageDetector.cs (1)
360if (argument.Kind != TypedConstantKind.Primitive || argument.Value is not string argString)
Microsoft.CodeAnalysis.VisualBasic (2)
Symbols\Source\SourceParameterSymbol.vb (1)
280If correctedParameterName.Equals(oldTypedConstant.Value.ToString(), StringComparison.Ordinal) Then
Symbols\TypedConstant.vb (1)
38Return "GetType(" & constant.Value.ToString() & ")"
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (82)
Attributes\AttributeTests.vb (25)
268Assert.Equal(Configuration.Assemblies.AssemblyHashAlgorithm.MD5, CType(a.CommonConstructorArguments(0).Value, Configuration.Assemblies.AssemblyHashAlgorithm)) 278Assert.Equal(True, a.CommonConstructorArguments(0).Value) 283Assert.Equal(AssemblyNameFlags.Retargetable, CType(a.CommonConstructorArguments(0).Value, AssemblyNameFlags)) 288Assert.Equal("MyKey.snk", a.CommonConstructorArguments(0).Value) 293Assert.Equal("Key Name", a.CommonConstructorArguments(0).Value) 298Assert.Equal("1.2.*", a.CommonConstructorArguments(0).Value) 303Assert.Equal("4.3.2.100", a.CommonConstructorArguments(0).Value) 1221Assert.Equal(CType(tc.Value, Int32), &HABCDEF) 1950Assert.False(DirectCast(gt.Value, TypeSymbol).IsErrorType) 1951Dim arg = DirectCast(gt.Value, UnboundGenericType) 2002Assert.False(DirectCast(gt.Value, TypeSymbol).IsErrorType) 2003Dim arg = DirectCast(gt.Value, UnboundGenericType) 2037Assert.False(DirectCast(gt.Value, TypeSymbol).IsErrorType) 2038Dim arg = DirectCast(gt.Value, ArrayTypeSymbol) 2081Assert.False(DirectCast(gt.Value, TypeSymbol).IsErrorType) 2082Dim arg = DirectCast(gt.Value, SubstitutedNamedType) 2245Assert.Equal("M0", attrs.Single().ConstructorArguments.Single().Value) 4082Assert.Throws(Of InvalidOperationException)(Function() args(0).Value) 4086Assert.Throws(Of InvalidOperationException)(Function() args(1).Value) 4092Assert.Throws(Of InvalidOperationException)(Function() named("P").Value) 4096Assert.Throws(Of InvalidOperationException)(Function() named("F").Value) 4181Assert.Null(args(0).Value) 4185Assert.Null(args(1).Value) 4438Dim typeInAttribute = DirectCast(type.GetAttributes()(0).ConstructorArguments(0).Value, NamedTypeSymbol) 4448typeInAttribute = DirectCast(type.GetAttributes()(0).ConstructorArguments(0).Value, NamedTypeSymbol)
Attributes\AttributeTests_Synthesized.vb (10)
614Return DirectCast(dd.ConstructorArguments.Single().Value, String) 1436Return DirectCast(attributes.Single(Function(a) a.AttributeClass.Name = "DebuggerBrowsableAttribute").ConstructorArguments(0).Value(), DebuggerBrowsableState) 1465Dim attributeArg = DirectCast(asyncMethodAttributes.Single().ConstructorArguments.Single().Value, NamedTypeSymbol) 1492Dim attributeArg = DirectCast(asyncMethodAttributes.First().ConstructorArguments.Single().Value, NamedTypeSymbol) 1522Dim attributeArg = DirectCast(asyncMethodAttributes.Single().ConstructorArguments.First().Value, NamedTypeSymbol) 1552Dim attributeArg = DirectCast(asyncMethodAttributes.First().ConstructorArguments.First().Value, NamedTypeSymbol) 1580Dim attributeStateMachineClass = DirectCast(asyncMethodAttributes.Single().ConstructorArguments.Single().Value, NamedTypeSymbol) 1663Dim attributeArg = DirectCast(iteratorMethodAttributes.Single().ConstructorArguments.Single().Value, NamedTypeSymbol) 1698Dim attributeArg = DirectCast(smAttribute.ConstructorArguments.First().Value, NamedTypeSymbol) 1727Dim attributeStateMachineClass = DirectCast(iteratorMethodAttributes.Single().ConstructorArguments.Single().Value, NamedTypeSymbol)
Attributes\AttributeTests_Tuples.vb (1)
444Return DirectCast(constant.Value, String)
Attributes\AttributeTests_WellKnownAttributes.vb (44)
73Assert.Equal(3, attrSym.CommonConstructorArguments(2).Value) 103Assert.Equal("ABCDEF5D-2448-447A-B786-64682CBEF123", attrSym.CommonConstructorArguments(0).Value) 108Assert.Equal(ComInterfaceType.InterfaceIsIUnknown, CType(attrSym.CommonConstructorArguments(0).Value, ComInterfaceType)) 111Assert.Equal("Object", CType(attrSym.CommonConstructorArguments(0).Value, Symbol).ToDisplayString()) 114Assert.Equal(TypeLibTypeFlags.FAggregatable, CType(attrSym.CommonConstructorArguments(0).Value, TypeLibTypeFlags)) 117Assert.Equal(False, attrSym.CommonConstructorArguments(0).Value) 121Assert.Equal(True, attrSym.CommonNamedArguments(0).Value.Value) 141Assert.Equal(TypeLibFuncFlags.FDefaultBind, CType(attrSym.CommonConstructorArguments(0).Value, TypeLibFuncFlags)) ' 32 211Assert.Equal(False, attrSym.CommonConstructorArguments(0).Value) 215Assert.Equal(CallingConvention.StdCall, CType(attrSym.CommonConstructorArguments(0).Value, CallingConvention)) ' 3 219Assert.Equal(True, attrSym.CommonNamedArguments(0).Value.Value) 221Assert.Equal(CharSet.Ansi, CType(attrSym.CommonNamedArguments(1).Value.Value, CharSet)) 223Assert.Equal(True, attrSym.CommonNamedArguments(2).Value.Value) 225Assert.Equal(True, attrSym.CommonNamedArguments(3).Value.Value) 232Assert.Equal("Object", CType(attrSym.CommonConstructorArguments(0).Value, Symbol).ToDisplayString()) 236Assert.Equal("ProgId", attrSym.CommonConstructorArguments(0).Value) 240Assert.Equal(123, attrSym.CommonConstructorArguments(0).Value) 242Assert.Equal(1, attrSym.CommonConstructorArguments(0).Value) 253Assert.Equal(True, attrSym.CommonConstructorArguments(0).Value) 257Assert.Equal("EGoo, InteropAttribute, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", attrSym.CommonConstructorArguments(1).Value) 266Assert.Equal(TypeLibVarFlags.FDisplayBind, CType(attrSym.CommonConstructorArguments(0).Value, TypeLibVarFlags)) 272Assert.Equal("message", attrSym.CommonConstructorArguments(0).Value) 273Assert.Equal(False, attrSym.CommonConstructorArguments(1).Value) 963Assert.Equal("unmanaged.dll", attrSym.CommonConstructorArguments(0).Value) 967Assert.Equal(CallingConvention.FastCall, CType(attrSym.CommonNamedArguments(0).Value.Value, CallingConvention)) 969Assert.Equal(True, attrSym.CommonNamedArguments(1).Value.Value) 974Assert.Equal("user32.dll", attrSym.CommonConstructorArguments(0).Value) 978Assert.Equal(CharSet.Unicode, CType(attrSym.CommonNamedArguments(0).Value.Value, CharSet)) 981Assert.Equal(False, attrSym.CommonNamedArguments(1).Value.Value) 1200Assert.Equal("user32.dll", attrSym.CommonConstructorArguments(0).Value) 1204Assert.Equal(CharSet.Unicode, CType(attrSym.CommonNamedArguments(0).Value.Value, CharSet)) 3369Dim arg = DirectCast(gt.Value, UnboundGenericType) 3441Assert.Equal(AttributeTargets.Class, DirectCast(attrSym.CommonConstructorArguments(0).Value, AttributeTargets)) 3445Assert.Equal(True, attrSym.CommonNamedArguments(0).Value.Value) 3450Assert.Equal(AttributeTargets.Class, DirectCast(attrSym.CommonConstructorArguments(0).Value, AttributeTargets)) 3454Assert.Equal(True, attrSym.CommonNamedArguments(0).Value.Value) 6753ConstructorArguments.Single().Value, NamedTypeSymbol). 6758ConstructorArguments.Single().Value, NamedTypeSymbol). 6763ConstructorArguments.Single().Value, NamedTypeSymbol). 6768ConstructorArguments.Single().Value, NamedTypeSymbol). 6870ConstructorArguments.Single().Value, NamedTypeSymbol))) 6875ConstructorArguments.Single().Value, NamedTypeSymbol))) 6880ConstructorArguments.Single().Value, NamedTypeSymbol))) 6885ConstructorArguments.Single().Value, NamedTypeSymbol)))
CodeGen\CodeGenAsyncTests.vb (1)
8370result &= arg.Value.ToString()
Emit\OptionalArgumentsTests.vb (1)
1003Assert.Equal(expectedDefault, argument.Value)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (4)
Semantics\MultiDimensionalTest.vb (4)
2710Dim a1 = DirectCast(p.GetMember(Of MethodSymbol)("Test1").GetAttributes().Single().ConstructorArguments.Single().Value, ArrayTypeSymbol) 2715Dim a2 = DirectCast(p.GetMember(Of MethodSymbol)("Test2").GetAttributes().Single().ConstructorArguments.Single().Value, ArrayTypeSymbol) 2720Assert.True(DirectCast(p.GetMember(Of MethodSymbol)("Test3").GetAttributes().Single().ConstructorArguments.Single().Value, TypeSymbol).IsErrorType()) 2721Assert.True(DirectCast(p.GetMember(Of MethodSymbol)("Test4").GetAttributes().Single().ConstructorArguments.Single().Value, TypeSymbol).IsErrorType())
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (158)
SymbolsTests\Metadata\PE\LoadingAttributes.vb (105)
101Assert.Equal(True, aBoolInst.CommonConstructorArguments.Single().Value) 104Assert.Equal(CByte(1), aByteInst.CommonConstructorArguments.Single().Value) 107Assert.Equal("a"c, aCharInst.CommonConstructorArguments.Single().Value) 110Assert.Equal(3.14159F, aSingleInst.CommonConstructorArguments.Single().Value) 113Assert.Equal(3.1415926, aDoubleInst.CommonConstructorArguments.Single().Value) 116Assert.Equal(16S, aInt16Inst.CommonConstructorArguments.Single().Value) 119Assert.Equal(32, aInt32Inst.CommonConstructorArguments.Single().Value) 122Assert.Equal(64L, aInt64Inst.CommonConstructorArguments.Single().Value) 125Assert.Equal("object", aObjectInst.CommonConstructorArguments.Single().Value) 128Assert.Equal("assembly", aStringInst.CommonConstructorArguments.Single().Value) 131Assert.Equal("System.String", CType(aTypeInst.CommonConstructorArguments.Single().Value, Symbol).ToDisplayString(SymbolDisplayFormat.TestFormat)) 173Assert.Equal(True, aBoolInst.CommonConstructorArguments.Single().Value) 176Assert.Equal(CByte(1), aByteInst.CommonConstructorArguments.Single().Value) 179Assert.Equal("a"c, aCharInst.CommonConstructorArguments.Single().Value) 182Assert.Equal(3.14159F, aSingleInst.CommonConstructorArguments.Single().Value) 185Assert.Equal(3.1415926, aDoubleInst.CommonConstructorArguments.Single().Value) 188Assert.Equal(16S, aInt16Inst.CommonConstructorArguments.Single().Value) 191Assert.Equal(32, aInt32Inst.CommonConstructorArguments.Single().Value) 194Assert.Equal(64L, aInt64Inst.CommonConstructorArguments.Single().Value) 197Assert.Equal("object", aObjectInst.CommonConstructorArguments.Single().Value) 200Assert.Equal("module", aStringInst.CommonConstructorArguments.Single().Value) 203Assert.Equal("System.String", CType(aTypeInst.CommonConstructorArguments.Single().Value, Symbol).ToDisplayString(SymbolDisplayFormat.TestFormat)) 246Assert.Equal("C1", c1.GetAttributes.First().CommonConstructorArguments.Single().Value) 249Assert.Equal("InnerC1", innerC1.GetAttributes.First().CommonConstructorArguments.Single().Value) 256Assert.Equal("InnerC2", innerC2.GetAttributes.First().CommonConstructorArguments.Single().Value) 259Assert.Equal("field1", field1.GetAttributes.First().CommonConstructorArguments.Single().Value) 262Assert.Equal("Property1", property1.GetAttributes.First().CommonConstructorArguments.Single().Value) 265Assert.Equal("Sub1", sub1.GetAttributes.First().CommonConstructorArguments.Single().Value) 268Assert.Equal("p1", sub1P1.GetAttributes.First().CommonConstructorArguments.Single().Value) 271Assert.Equal("Function1", function1.GetAttributes.First().CommonConstructorArguments.Single().Value) 274Assert.Equal("p1", function1P1.GetAttributes.First().CommonConstructorArguments.Single().Value) 316Assert.Equal(True, kv.Value.Value) 321Assert.Equal(CByte(1), kv.Value.Value) 326Assert.Equal("b"c, kv.Value.Value) 331Assert.Equal(0, CType(kv.Value.Value, Integer)) 336Assert.Equal(3.14159F, kv.Value.Value) 341Assert.Equal(3.1415926, kv.Value.Value) 346Assert.Equal(16S, kv.Value.Value) 351Assert.Equal(32, kv.Value.Value) 356Assert.Equal(64L, kv.Value.Value) 361Assert.Equal(c3, kv.Value.Value) 450Assert.Equal("C1", c1.GetAttributes.First().CommonConstructorArguments.Single().Value) 456Assert.Equal("Integer", returnAttributes.First().CommonConstructorArguments.Single().Value) 462Assert.Equal("Integer", returnAttributes.First().CommonConstructorArguments.Single().Value) 496Assert.Equal("System.Collections.Generic.List(Of )", DirectCast(l.GetAttributes.First().CommonConstructorArguments.Single().Value, Symbol).ToDisplayString(SymbolDisplayFormat.TestFormat)) 499Assert.Equal("System.Collections.Generic.List(Of C1)", DirectCast(l.GetAttributes.First().CommonConstructorArguments.Single().Value, Symbol).ToDisplayString(SymbolDisplayFormat.TestFormat)) 502Assert.Equal("System.Collections.Generic.List(Of System.String)", DirectCast(l.GetAttributes.First().CommonConstructorArguments.Single().Value, Symbol).ToDisplayString(SymbolDisplayFormat.TestFormat)) 505Assert.Equal("System.Collections.Generic.List(Of System.Collections.Generic.KeyValuePair(Of C1, System.String))", DirectCast(l.GetAttributes.First().CommonConstructorArguments.Single().Value, Symbol).ToDisplayString(SymbolDisplayFormat.TestFormat)) 508Assert.Equal("System.Collections.Generic.List(Of System.Collections.Generic.KeyValuePair(Of System.String, C1.InnerC1(Of System.Int32).InnerC2(Of System.String, System.String)))", DirectCast(l.GetAttributes.First().CommonConstructorArguments.Single().Value, Symbol).ToDisplayString(SymbolDisplayFormat.TestFormat)) 687Assert.Equal("InteropAttributes", a.CommonConstructorArguments(0).Value) 691Assert.Equal(2, a.CommonConstructorArguments(1).Value) 696Assert.Equal("1234C65D-1234-447A-B786-64682CBEF136", a.CommonConstructorArguments(0).Value) 699Assert.Equal(False, a.CommonConstructorArguments(0).Value) 703Assert.Equal(True, a.CommonNamedArguments(0).Value.Value) 707Assert.Equal(False, a.CommonConstructorArguments(0).Value) 714Assert.Equal(2, a.CommonConstructorArguments(0).Value) 718Assert.Equal(3, a.CommonConstructorArguments(2).Value) 725Assert.Equal(True, a.CommonConstructorArguments(0).Value) 732Assert.Equal(8, a.CommonConstructorArguments(0).Value) 737Assert.Equal(True, a.CommonNamedArguments(0).Value.Value) 784Assert.Equal(GetType(String), attrSym.CommonConstructorArguments(0).Value.GetType()) 785Assert.Equal("ABCDEF5D-2448-447A-B786-64682CBEF123", attrSym.CommonConstructorArguments(0).Value) 792Assert.Equal(GetType(Int32), attrSym.CommonConstructorArguments(0).Value.GetType()) 793Assert.Equal(1, attrSym.CommonConstructorArguments(0).Value) 798Assert.Equal("Object", CType(attrSym.CommonConstructorArguments(0).Value, Symbol).ToString()) 810Assert.Equal(32, attrSym.CommonConstructorArguments(0).Value) 839Assert.Equal(False, attrSym.CommonConstructorArguments(0).Value) 844Assert.Equal(3, attrSym.CommonConstructorArguments(0).Value) 848Assert.Equal(True, attrSym.CommonNamedArguments(0).Value.Value) 850Assert.Equal(2, attrSym.CommonNamedArguments(1).Value.Value) 852Assert.Equal(True, attrSym.CommonNamedArguments(2).Value.Value) 854Assert.Equal(True, attrSym.CommonNamedArguments(3).Value.Value) 892Assert.Equal("message", attrSym.CommonConstructorArguments(0).Value) 893Assert.Equal(False, attrSym.CommonConstructorArguments(1).Value) 950Assert.Equal(cbar, attrSym.CommonConstructorArguments(0).Value) 954Assert.Equal("MyIndex", attrSym.CommonConstructorArguments(0).Value) 960Assert.Equal(10, mem.GetAttributes().First().CommonConstructorArguments(0).Value) 993Assert.Equal(1, attrSym.CommonConstructorArguments(0).Value) 1026Assert.Equal(CUShort(321), attrSym.CommonNamedArguments(0).Value.Value) 1032Assert.Equal("System.Collections.Generic.Dictionary(Of String, Integer)", TryCast(attrSym.CommonNamedArguments(0).Value.Value, TypeSymbol).ToString()) 1033Assert.Equal(2, TryCast(attrSym.CommonNamedArguments(0).Value.Value, NamedTypeSymbol).Arity) 1071Assert.Equal(3.1415926, attrSym.CommonConstructorArguments(0).Value) 'object 1078Assert.Equal("q"c, attrSym.CommonConstructorArguments(0).Value) 1079Assert.Equal(CByte(2), attrSym.CommonConstructorArguments(1).Value) 1089Assert.Equal("555", attrSym.CommonConstructorArguments(0).Value) ' object 1104Assert.Equal("System.Collections.Generic.IList(Of )", TryCast(attrSym.CommonNamedArguments(0).Value.Value, NamedTypeSymbol).ToString()) 1204Assert.Equal(-1, prop.GetAttributes().First().CommonConstructorArguments(0).Value) 1219Assert.Equal(-8, attrSym.CommonConstructorArguments(0).Value) ' object 1220Assert.Equal(CByte(255), attrSym.CommonConstructorArguments(1).Value) 1227Assert.Equal(7, attrSym.CommonConstructorArguments(0).Value) ' object 1228Assert.Equal(256&, attrSym.CommonConstructorArguments(1).Value) 1230Assert.Equal(0.123!, attrSym.CommonConstructorArguments(2).Value) 1231Assert.Equal(CShort(-2), attrSym.CommonConstructorArguments(3).Value) 1239Assert.Equal("AttributeUse.IFoo(Of System.Int16, System.UInt16)", TryCast(attrSym.CommonConstructorArguments(0).Value, NamedTypeSymbol).ToDisplayString(SymbolDisplayFormat.TestFormat)) 1240Assert.Equal(1, attrSym.CommonNamedArguments(0).Value.Value) 1262Assert.Equal("4.0.30319.18408", attr1.CommonConstructorArguments(0).Value) 1266Assert.Equal("4.0.30319.18408", attr1.CommonConstructorArguments(0).Value) 1292Assert.Equal("System.Linq.Expressions.Expression.BinaryExpressionProxy", CType(attr1.CommonConstructorArguments(0).Value, TypeSymbol).ToDisplayString(SymbolDisplayFormat.TestFormat)) 1297Assert.Equal("System.Linq.Expressions.Expression.TypeBinaryExpressionProxy", CType(attr1.CommonConstructorArguments(0).Value, TypeSymbol).ToDisplayString(SymbolDisplayFormat.TestFormat)) 1325Assert.Equal("genericUriParserOptions", attr.CommonConstructorArguments(0).Value) 1328Assert.Equal(0, attr.CommonNamedArguments(0).Value.Value) 1330Assert.Equal(True, attr.CommonNamedArguments(1).Value.Value) 1363Assert.Equal("DataCategory_Mapping", attr.CommonConstructorArguments(0).Value) 1367Assert.Equal("DataAdapter_MissingMappingAction", attr.CommonConstructorArguments(0).Value) 1371Assert.Equal(1, attr.CommonConstructorArguments(0).Value)
SymbolsTests\Retargeting\NoPia.vb (42)
1120Assert.Equal("Pia", DirectCast(args(0).Value, TypeSymbol).ContainingAssembly.Name) 1121Assert.IsType(Of UnsupportedMetadataTypeSymbol)(args(1).Value) 1131Assert.Equal("Pia", DirectCast(args(0).Value, TypeSymbol).ContainingAssembly.Name) 1132Assert.IsType(Of UnsupportedMetadataTypeSymbol)(args(1).Value) 1142Assert.Equal("Pia", DirectCast(args(0).Value, TypeSymbol).ContainingAssembly.Name) 1143Assert.IsType(Of UnsupportedMetadataTypeSymbol)(args(1).Value) 1153Assert.Equal("Pia", DirectCast(args(0).Value, TypeSymbol).ContainingAssembly.Name) 1154Assert.IsType(Of UnsupportedMetadataTypeSymbol)(args(1).Value) 1211Assert.Equal("Pia", DirectCast(args(0).Value, TypeSymbol).ContainingAssembly.Name) 1212Assert.IsType(Of UnsupportedMetadataTypeSymbol)(args(1).Value) 1222Assert.Equal("Pia", DirectCast(args(0).Value, TypeSymbol).ContainingAssembly.Name) 1223Assert.IsType(Of UnsupportedMetadataTypeSymbol)(args(1).Value) 1233Assert.Equal("Pia", DirectCast(args(0).Value, TypeSymbol).ContainingAssembly.Name) 1234Assert.IsType(Of UnsupportedMetadataTypeSymbol)(args(1).Value) 1244Assert.Equal("Pia", DirectCast(args(0).Value, TypeSymbol).ContainingAssembly.Name) 1245Assert.IsType(Of UnsupportedMetadataTypeSymbol)(args(1).Value) 1302Assert.Equal("LocalTypes2", DirectCast(args(0).Value, TypeSymbol).ContainingAssembly.Name) 1303Assert.Equal("LocalTypes2", DirectCast(args(1).Value, TypeSymbol).ContainingAssembly.Name) 1313Assert.Equal("LocalTypes2", DirectCast(args(0).Value, TypeSymbol).ContainingAssembly.Name) 1314Assert.Equal("LocalTypes2", DirectCast(args(1).Value, TypeSymbol).ContainingAssembly.Name) 1324Assert.Equal("LocalTypes2", DirectCast(args(0).Value, TypeSymbol).ContainingAssembly.Name) 1325Assert.Equal("LocalTypes2", DirectCast(args(1).Value, TypeSymbol).ContainingAssembly.Name) 1335Assert.Equal("LocalTypes2", DirectCast(args(0).Value, TypeSymbol).ContainingAssembly.Name) 1336Assert.Equal("LocalTypes2", DirectCast(args(1).Value, TypeSymbol).ContainingAssembly.Name) 1384Assert.Equal("Pia", DirectCast(args(0).Value, TypeSymbol).ContainingAssembly.Name) 1385Assert.IsType(Of UnsupportedMetadataTypeSymbol)(args(1).Value) 1395Assert.Equal("Pia", DirectCast(args(0).Value, TypeSymbol).ContainingAssembly.Name) 1396Assert.IsType(Of UnsupportedMetadataTypeSymbol)(args(1).Value) 1454Assert.Equal("Pia", DirectCast(args(0).Value, TypeSymbol).ContainingAssembly.Name) 1455Assert.IsType(Of UnsupportedMetadataTypeSymbol)(args(1).Value) 1465Assert.Equal("Pia", DirectCast(args(0).Value, TypeSymbol).ContainingAssembly.Name) 1466Assert.IsType(Of UnsupportedMetadataTypeSymbol)(args(1).Value) 1476Assert.Equal("Pia", DirectCast(args(0).Value, TypeSymbol).ContainingAssembly.Name) 1477Assert.IsType(Of UnsupportedMetadataTypeSymbol)(args(1).Value) 1487Assert.Equal("Pia", DirectCast(args(0).Value, TypeSymbol).ContainingAssembly.Name) 1488Assert.IsType(Of UnsupportedMetadataTypeSymbol)(args(1).Value) 1547Dim argType = DirectCast(type.GetAttributes()(0).CommonConstructorArguments(0).Value, TypeSymbol) 1551argType = DirectCast(type.GetAttributes()(0).CommonConstructorArguments(0).Value, TypeSymbol) 1555argType = DirectCast(type.GetAttributes()(0).CommonConstructorArguments(0).Value, TypeSymbol) 1562argType = DirectCast(type.GetAttributes()(0).CommonConstructorArguments(0).Value, TypeSymbol) 1565argType = DirectCast(type.GetAttributes()(0).CommonConstructorArguments(0).Value, TypeSymbol) 1569argType = DirectCast(type.GetAttributes()(0).CommonConstructorArguments(0).Value, TypeSymbol)
SymbolsTests\Retargeting\RetargetingCustomAttributes.vb (4)
280Assert.Throws(Of InvalidOperationException)(Function() args(0).Value) 284Assert.Throws(Of InvalidOperationException)(Function() args(1).Value) 290Assert.Throws(Of InvalidOperationException)(Function() named("P").Value) 294Assert.Throws(Of InvalidOperationException)(Function() named("F").Value)
SymbolsTests\Source\ComClassTests.vb (2)
92application.Add(<a><%= arg.Value.ToString() %></a>) 96application.Add(<Named Name=<%= named.Key %>><%= named.Value.Value.ToString() %></Named>)
SymbolsTests\Source\PropertyTests.vb (1)
2714Assert.Equal(attribute.ConstructorArguments(0).Value, name)
SymbolsTests\TypedConstantTests.vb (4)
38Assert.Equal(common.Value, lang.Value) 42Assert.Equal(common.Value, common2.Value)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (4)
Extensions.vb (4)
184Return expected.Equals(arg.Value) 186Dim typeSym = TryCast(arg.Value, TypeSymbol) 216Return If(expected Is Nothing, arg.Value Is Nothing, expected.Equals(CType(arg.Value, T)))
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
CodeGeneration\ExpressionGenerator.vb (3)
21Return GenerateExpression(generator, typedConstant.Type, typedConstant.Value, canUseFieldReference:=True) 31If Not TypeOf typedConstant.Value Is ITypeSymbol Then 35Return SyntaxFactory.GetTypeExpression(DirectCast(typedConstant.Value, ITypeSymbol).GenerateTypeSyntax())
Microsoft.CodeAnalysis.Workspaces (3)
FindSymbols\FindReferences\DependentProjectsFinder.cs (1)
244typeNameConstant.Value is not string value)
Shared\Extensions\ISymbolExtensions.cs (2)
142attribute.ConstructorArguments is [{ Value: int value }]) 199var argumentValue = attribute.ConstructorArguments.First().Value;