740 references to Attribute
aspire (31)
Aspire.Cli.EndToEnd.Tests (36)
IntegrationSourceTests.cs (12)
43Assert.Equal(expectedKeys, configuredSources.Select(source => (string?)source.Attribute("key")));
44var publicSource = Assert.Single(configuredSources, source => (string?)source.Attribute("key") == "nuget.org");
45Assert.Equal("https://api.nuget.org/v3/index.json", (string?)publicSource.Attribute("value"));
48Assert.Equal(expectedKeys, mappings.Elements("packageSource").Select(source => (string?)source.Attribute("key")));
50Assert.Equal(["*"], source.Elements("package").Select(package => (string?)package.Attribute("pattern"))));
125.Where(source => (string?)source.Attribute("value") == containerFeed) ?? []);
152source => (string?)source.Attribute("value") == containerFeed);
153var sourceKey = addedSource.Attribute("key")!.Value;
157var mapping = Assert.Single(mappings, source => (string?)source.Attribute("key") == sourceKey);
158Assert.Equal([packageId], mapping.Elements("package").Select(package => (string?)package.Attribute("pattern")));
192string.Equals((string?)source.Attribute("key"), "nuget.org", StringComparison.OrdinalIgnoreCase)))
201new XElement("packageSource", new XAttribute("key", source.Attribute("key")!.Value),
Aspire.Cli.Tests (180)
DotNet\DotNetAppHostNuGetConfigMergerTests.cs (48)
585Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://feed1.example");
586Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://feed2.example");
625Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://feed2.example");
629Assert.NotNull(psm.Elements("packageSource").First().Elements("package").FirstOrDefault(p => (string?)p.Attribute("pattern") == "Aspire.*"));
665packageSources.Elements("add").Select(e => (string?)e.Attribute("value")));
781.Select(static source => (string?)source.Attribute("value")));
903.Where(element => element.Elements("package").Any(package => package.Attribute("pattern")?.Value == "*"))
904.Select(element => element.Attribute("key")!.Value)
1017Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("key") == "nuget" && (string?)e.Attribute("value") == "https://api.nuget.org/v3/index.json");
1018Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("key") == "dotnet9" && (string?)e.Attribute("value") == "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json");
1021Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://example.com/aspire-feed");
1058Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("key") == "nuget.org");
1059Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("key") == "custom");
1062Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://example.com/aspire-daily");
1110Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("key") == "nuget.org");
1113Assert.Contains(packageSources.Elements("add"), e => (string?)e.Attribute("value") == "https://example.com/aspire-daily");
1123var nugetMapping = psm.Elements("packageSource").FirstOrDefault(ps => (string?)ps.Attribute("key") == "nuget.org");
1125Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*");
1128var aspireMapping = psm.Elements("packageSource").FirstOrDefault(ps => (string?)ps.Attribute("key") == "aspire-test");
1130Assert.Contains(aspireMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "Aspire*");
1131Assert.Contains(aspireMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "Microsoft.Extensions.ServiceDiscovery*");
1177.FirstOrDefault(ps => (string?)ps.Attribute("key") == "nuget.org");
1179Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*");
1183.FirstOrDefault(ps => (string?)ps.Attribute("key") == "github");
1185Assert.Contains(githubMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "myorg.*");
1186Assert.Contains(githubMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "other");
1187Assert.DoesNotContain(githubMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*");
1234e => (string?)e.Attribute("value") == "C:\\Users\\user\\.aspire\\hives\\invalid-pr");
1238e => (string?)e.Attribute("value") == "https://valid.example");
1247ps => (string?)ps.Attribute("key") == "C:\\Users\\user\\.aspire\\hives\\invalid-pr");
1251.FirstOrDefault(ps => (string?)ps.Attribute("key") == "https://valid.example");
1253Assert.Contains(validExampleMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "ValidPkg*");
1254Assert.DoesNotContain(validExampleMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "*");
1258.FirstOrDefault(ps => (string?)ps.Attribute("key") == "aspire-test");
1260Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "Aspire*");
1261Assert.Contains(nugetMapping.Elements("package"), p => (string?)p.Attribute("pattern") == "Microsoft.Extensions.ServiceDiscovery*");
1264nugetMapping.Elements("package").Select(p => (string)p.Attribute("pattern")!));
1316e => string.Equals((string?)e.Attribute("value"), oldHive, StringComparison.Ordinal));
1318e => string.Equals((string?)e.Attribute("value"), newHive, StringComparison.Ordinal));
1322ps => string.Equals((string?)ps.Attribute("key"), oldHive, StringComparison.Ordinal));
1366e => string.Equals((string?)e.Attribute("value"), oldHive, StringComparison.Ordinal));
1732.Select(static source => source.Attribute("key")!.Value).Order(StringComparer.Ordinal));
1734.Where(static mapping => mapping.Attribute("key")?.Value == "aspire-staging")
1736.Select(static pattern => pattern.Attribute("pattern")!.Value);
1796.Select(static source => source.Attribute("key")!.Value));
1799.Select(static mapping => mapping.Attribute("key")!.Value) ?? []);
Projects\PrebuiltAppHostServerTests.cs (44)
459Assert.Equal("/path/to/MyIntegration.csproj", projectElements[0].Attribute("Include")?.Value);
465Assert.Equal("Aspire.Hosting", packageReference.Attribute("Include")?.Value);
466Assert.Equal("13.5.0", packageReference.Attribute("Version")?.Value);
490Assert.Equal("Aspire.Hosting", packageReference.Attribute("Include")?.Value);
491Assert.Equal("13.5.0", packageReference.Attribute("Version")?.Value);
495Assert.Equal("Aspire.Hosting.Redis", packageReference.Attribute("Include")?.Value);
496Assert.Equal("13.5.0", packageReference.Attribute("Version")?.Value);
511Assert.Equal("[13.5.0]", packageReference.Attribute("Version")?.Value);
809.Select(static source => source.Attribute("value")!.Value)
851Assert.Equal(restoreConfiguration.PackageSourceAlias, projectSource.Attribute("key")?.Value);
852Assert.Equal(feedDirectory.FullName, projectSource.Attribute("value")?.Value);
912.FirstOrDefault(element => element.Attribute("Name")?.Value == "_WriteAspireClosureManifest");
915Assert.Equal("Build", target.Attribute("AfterTargets")?.Value);
916Assert.Equal("ResolveLockFileCopyLocalFiles", target.Attribute("DependsOnTargets")?.Value);
1417.FirstOrDefault(a => string.Equals(a.Attribute("key")?.Value, "globalPackagesFolder", StringComparison.OrdinalIgnoreCase));
1419var gpfValue = gpf.Attribute("value")?.Value;
1477.FirstOrDefault(a => string.Equals(a.Attribute("key")?.Value, "globalPackagesFolder", StringComparison.OrdinalIgnoreCase));
1479var gpfValue = gpf.Attribute("value")?.Value;
1967.FirstOrDefault(a => string.Equals(a.Attribute("key")?.Value, "globalPackagesFolder", StringComparison.OrdinalIgnoreCase));
1971var gpfValue = gpf.Attribute("value")?.Value;
3355.Single(element => element.Attribute("key")?.Value == "globalPackagesFolder")
3356.Attribute("value")?
3392.Select(static source => source.Attribute("key")!.Value));
3401Assert.Equal("Aspire.Hosting", packageElement.Attribute("Include")?.Value);
3402Assert.Equal("13.4.0-pr.17141.gf142085f", packageElement.Attribute("Version")?.Value);
3406Assert.Equal("Aspire.Hosting.Redis", packageElement.Attribute("Include")?.Value);
3407Assert.Equal("13.4.0-pr.17141.gf142085f", packageElement.Attribute("Version")?.Value);
3754ambientConfig.Descendants("config").Elements("add").Single().Attribute("value")?.Value);
4316.Attribute("key")?
4325Assert.Equal("Aspire.Hosting", packageElement.Attribute("Include")?.Value);
4326Assert.Equal("[13.4.0-pr.17166.ga49d604d]", packageElement.Attribute("Version")?.Value);
4330Assert.Equal("Aspire.Hosting.Redis", packageElement.Attribute("Include")?.Value);
4331Assert.Equal("[13.4.0-pr.17166.ga49d604d]", packageElement.Attribute("Version")?.Value);
4335Assert.Equal("CommunityToolkit.Aspire.Hosting.Redis", packageElement.Attribute("Include")?.Value);
4336Assert.Equal("1.0.0", packageElement.Attribute("Version")?.Value);
4544Assert.Equal("Aspire.Hosting", packageReference.Attribute("Include")?.Value);
4545Assert.Equal("13.2.0", packageReference.Attribute("Version")?.Value);
4549Assert.Equal("Aspire.Hosting.Redis", packageReference.Attribute("Include")?.Value);
4550Assert.Equal("13.2.0", packageReference.Attribute("Version")?.Value);
5489element.Attribute("value")?.Value,
5491?.Attribute("key")
5494.Select(static element => element.Attribute("key")?.Value)
5518element.Attribute("key")?.Value,
5522.Select(static element => element.Attribute("pattern")?.Value)
Aspire.Dashboard (1)
Aspire.Dashboard.Tests (2)
Aspire.Hosting.Azure.Provisioning.Generators (1)
Aspire.Hosting.Maui.Tests (11)
Aspire.Hosting.Native.CodeGeneration (7)
Aspire.Hosting.RemoteHost (7)
Aspire.Templates.Tests (9)
Aspire.Tray.Tests (1)
dotnet-svcutil-lib (2)
GenerateDocumentationAndConfigFiles (19)
GenerateTemplateManifest (6)
ilc (9)
Infrastructure.Tests (12)
Microsoft.AspNetCore.DataProtection (18)
Microsoft.AspNetCore.OpenApi.SourceGenerators (9)
Microsoft.AspNetCore.Rewrite (15)
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Microsoft.Build.Tasks.Core (12)
Microsoft.CodeAnalysis (1)
Microsoft.CodeAnalysis.Analyzers (20)
Microsoft.CodeAnalysis.AnalyzerUtilities (19)
Microsoft.CodeAnalysis.CodeStyle (16)
Microsoft.CodeAnalysis.CSharp (4)
Microsoft.CodeAnalysis.Features (3)
Microsoft.CodeAnalysis.NetAnalyzers (3)
Microsoft.CodeAnalysis.ResxSourceGenerator (20)
Microsoft.CodeAnalysis.Workspaces (19)
Microsoft.DotNet.Arcade.Sdk (3)
Microsoft.DotNet.Build.Manifest (1)
Microsoft.DotNet.Build.Tasks.Installers (8)
Microsoft.DotNet.Build.Tasks.Packaging (2)
Microsoft.DotNet.Build.Tasks.VisualStudio (2)
Microsoft.DotNet.Build.Tasks.Workloads (1)
Microsoft.DotNet.MacOsPkg.Core (2)
Microsoft.DotNet.NuGetRepack.Tasks (3)
Microsoft.DotNet.SourceBuild.Tasks (10)
Microsoft.DotNet.XliffTasks (22)
Microsoft.Extensions.FileProviders.Embedded (1)
Microsoft.Maui.Resizetizer (21)
Microsoft.NET.Build.Extensions.Tasks (3)
Microsoft.NET.Build.Tasks (26)
Microsoft.NET.ProjectData (9)
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (3)
Microsoft.NET.Sdk.Publish.Tasks (8)
Microsoft.NET.Sdk.StaticWebAssets.Tasks (4)
Microsoft.TestPlatform.TestHostRuntimeProvider (2)
NuGet.Configuration (12)
NuGet.PackageManagement (4)
NuGet.Packaging (31)
NuGet.Protocol (9)
Roslyn.Diagnostics.Analyzers (19)
sdk-tasks (12)
System.ComponentModel.TypeConverter (1)
System.Private.CoreLib.Generators (21)
System.Private.Xml.Linq (6)