Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
86d4207
Migrate Microsoft.DotNet.HotReload.Watch.Aspire.Tests to MSTest.Sdk o…
Evangelink Jun 11, 2026
52eade3
Bump MSTest.Sdk to 4.3.0-preview.26311.10 + apply skill review fixes
Evangelink Jun 11, 2026
75a20cf
Address review: use Assert.IsExactInstanceOfType<T> for xUnit IsType …
Evangelink Jun 11, 2026
27da8c4
Remove redundant Using of Microsoft.VisualStudio.TestTools.UnitTesting
Jun 11, 2026
7a551eb
Replace AssertEx.SequenceEqual with Assert.AreSequenceEqual
Jun 11, 2026
cb50989
Move FluentAssertions Using + AwesomeAssertions PackageReference to t…
BagOfMandMs Jun 12, 2026
ead0658
Restore Watch.Aspire ProjectReference in dotnet-watch.Tests.csproj
Evangelink Jun 12, 2026
fe718be
Add shared Microsoft.DotNet.Test.MSTest.Utilities project
Evangelink Jun 12, 2026
1a4c191
Migrate containerize.UnitTests to MSTest.Sdk on MTP
Evangelink Jun 11, 2026
bf18d59
Apply skill review fixes: Assert.HasCount(1,x) -> Assert.ContainsSing…
Evangelink Jun 11, 2026
72bc005
Remove redundant Using of Microsoft.VisualStudio.TestTools.UnitTesting
Jun 11, 2026
439fef5
Remove redundant <IsPackable>false</IsPackable> (MSTest.Sdk default)
Evangelink Jun 12, 2026
7750f28
Migrate Microsoft.DotNet.ApiCompat.Tests to MSTest.Sdk on MTP
Evangelink Jun 11, 2026
4aa3024
Remove redundant Using of Microsoft.VisualStudio.TestTools.UnitTesting
Jun 11, 2026
65cf486
Use built-in $(UsingMSTestSdk) property instead of custom $(UseMSTest…
Evangelink Jun 12, 2026
c58302d
Helix dispatcher: gate --report-trx on TrxReport extension being loaded
BagOfMandMs Jun 12, 2026
6f740e7
Restore Watch.Aspire ProjectReference in dotnet-watch.Tests.csproj
Evangelink Jun 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
"Microsoft.Build.NoTargets": "3.7.134",
"Microsoft.Build.Traversal": "4.1.82",
"Microsoft.WixToolset.Sdk": "6.0.3-dotnet.4",
"MSTest.Sdk": "4.3.0-preview.26307.5"
"MSTest.Sdk": "4.3.0-preview.26311.10"
}
}
1 change: 1 addition & 0 deletions sdk.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@
<Project Path="test/Microsoft.DotNet.MSBuildSdkResolver.Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests.csproj" />
<Project Path="test/Microsoft.DotNet.PackageInstall.Tests/Microsoft.DotNet.PackageInstall.Tests.csproj" />
<Project Path="test/Microsoft.DotNet.TemplateLocator.Tests/Microsoft.DotNet.TemplateLocator.Tests.csproj" />
<Project Path="test/Microsoft.DotNet.Test.MSTest.Utilities/Microsoft.DotNet.Test.MSTest.Utilities.csproj" />
<Project Path="test/Microsoft.DotNet.Tools.Tests.ComponentMocks/Microsoft.DotNet.Tools.Tests.ComponentMocks.csproj" />
<Project Path="test/Microsoft.Extensions.DotNetDeltaApplier.Tests/Microsoft.Extensions.DotNetDeltaApplier.Tests.csproj" />
<Project Path="test/Microsoft.NET.Build.Containers.IntegrationTests/Microsoft.NET.Build.Containers.IntegrationTests.csproj" />
Expand Down
1 change: 1 addition & 0 deletions src/Dotnet.Watch/Watch.Aspire/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("Microsoft.DotNet.HotReload.Watch.Aspire.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("dotnet-watch.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")]
1 change: 1 addition & 0 deletions src/Dotnet.Watch/dotnet-watch.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"test\\dotnet-watch-test-browser\\dotnet-watch-test-browser.csproj",
"test\\Microsoft.DotNet.HotReload.Test.Utilities\\Microsoft.DotNet.HotReload.Test.Utilities.csproj",
"test\\Microsoft.DotNet.HotReload.Watch.Aspire.Tests\\Microsoft.DotNet.HotReload.Watch.Aspire.Tests.csproj",
"test\\Microsoft.DotNet.Test.MSTest.Utilities\\Microsoft.DotNet.Test.MSTest.Utilities.csproj",
"test\\Microsoft.Extensions.DotNetDeltaApplier.Tests\\Microsoft.Extensions.DotNetDeltaApplier.Tests.csproj",
"test\\dotnet-watch.Tests\\dotnet-watch.Tests.csproj"
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="MSTest.Sdk">

<PropertyGroup>
<TargetFramework>$(SdkTargetFramework)</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
Expand All @@ -12,10 +11,9 @@
<ItemGroup>
<ProjectReference Include="$(RepoRoot)src\Compatibility\ApiCompat\Microsoft.DotNet.PackageValidation\Microsoft.DotNet.PackageValidation.csproj" />
<ProjectReference Include="$(RepoRoot)src\Compatibility\ApiCompat\Microsoft.DotNet.ApiCompat.Task\Microsoft.DotNet.ApiCompat.Task.csproj" />
<ProjectReference Include="..\Microsoft.NET.TestFramework\Microsoft.NET.TestFramework.csproj" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" />
</ItemGroup>

<Import Project="$(RepoRoot)src\Compatibility\ApiCompat\Microsoft.DotNet.ApiCompat.Shared\Microsoft.DotNet.ApiCompat.Shared.projitems" Label="Shared" />

</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.DotNet.ApiCompat;

namespace Microsoft.DotNet.ApiCompatibility.Tests
{
[TestClass]
public class RegexStringTransformerTests
{
[Fact]
[TestMethod]
public void Transform_CaptureGroupPatternDoesNotMatchInput_ReturnsInput()
{
const string CaptureGroupPattern = "(abc)def";
Expand All @@ -16,10 +17,10 @@ public void Transform_CaptureGroupPatternDoesNotMatchInput_ReturnsInput()

string output = new RegexStringTransformer(CaptureGroupPattern, ReplacementPattern).Transform(Input);

Assert.Equal(Input, output);
Assert.AreEqual(Input, output);
}

[Fact]
[TestMethod]
public void Transform_ReplacementPatternWithoutCaptureGroups_ReturnsReplacementPattern()
{
const string CaptureGroupPattern = "(abc)d*";
Expand All @@ -28,10 +29,10 @@ public void Transform_ReplacementPatternWithoutCaptureGroups_ReturnsReplacementP

string output = new RegexStringTransformer(CaptureGroupPattern, ReplacementPattern).Transform(Input);

Assert.Equal(ReplacementPattern, output);
Assert.AreEqual(ReplacementPattern, output);
}

[Fact]
[TestMethod]
public void Transform_ReplacementPatternWithTooManyReplacementMarkers_ReturnOutputWithoutTransformedReplacementMarkers()
{
const string CaptureGroupPattern = "(abc)(def)ghi";
Expand All @@ -40,10 +41,10 @@ public void Transform_ReplacementPatternWithTooManyReplacementMarkers_ReturnOutp

string output = new RegexStringTransformer(CaptureGroupPattern, ReplacementPattern).Transform(Input);

Assert.Equal("1:abc, 2:def, 3:$3", output);
Assert.AreEqual("1:abc, 2:def, 3:$3", output);
}

[Fact]
[TestMethod]
public void Transform_SameNumberOfGroupsAndMarkers_ReturnsExpected()
{
const string CaptureGroupPattern = @".+\\(.+)\\(.+)";
Expand All @@ -52,10 +53,10 @@ public void Transform_SameNumberOfGroupsAndMarkers_ReturnsExpected()

string output = new RegexStringTransformer(CaptureGroupPattern, ReplacementPattern).Transform(Input);

Assert.Equal("lib/net7.0-android/System.Linq.dll", output);
Assert.AreEqual("lib/net7.0-android/System.Linq.dll", output);
}

[Fact]
[TestMethod]
public void Transform_MultiplePatterns_ReturnsExpected()
{
var patterns = new (string, string)[]
Expand All @@ -69,7 +70,7 @@ public void Transform_MultiplePatterns_ReturnsExpected()

string output = new RegexStringTransformer(patterns).Transform(Input);

Assert.Equal("runtimes/android/lib/net7.0/System.Linq.dll", output);
Assert.AreEqual("runtimes/android/lib/net7.0/System.Linq.dll", output);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.DotNet.Test.MSTest.Utilities\Microsoft.DotNet.Test.MSTest.Utilities.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.DotNet.Watch.UnitTests;
using Microsoft.DotNet.Test.MSTest.Utilities;
using Microsoft.Extensions.Logging.Abstractions;

namespace Microsoft.DotNet.HotReload.UnitTests;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,145 +1,146 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.Extensions.Logging;

namespace Microsoft.DotNet.Watch.UnitTests;

[TestClass]
public class AspireHostLauncherCliTests
{
[Fact]
[TestMethod]
public void RequiredSdkOption()
{
// --sdk option is missing
var args = new[] { "host", "--entrypoint", "proj", "a", "b" };
var launcher = AspireLauncher.TryCreate(args);
Assert.Null(launcher);
Assert.IsNull(launcher);
}

[Fact]
[TestMethod]
public void RequiredEntryPointOption()
{
// --entrypoint option is missing
var args = new[] { "host", "--sdk", "sdk", "--verbose" };
var launcher = AspireLauncher.TryCreate(args);
Assert.Null(launcher);
Assert.IsNull(launcher);
}

[Fact]
[TestMethod]
public void ProjectAndSdkPaths()
{
var args = new[] { "host", "--sdk", "sdk", "--entrypoint", "myproject.csproj" };
var launcher = Assert.IsType<AspireHostLauncher>(AspireLauncher.TryCreate(args));
Assert.Equal("sdk", launcher.EnvironmentOptions.SdkDirectory);
Assert.True(launcher.EntryPoint.IsProjectFile);
Assert.Equal("myproject.csproj", launcher.EntryPoint.PhysicalPath);
Assert.Empty(launcher.ApplicationArguments);
Assert.Equal(LogLevel.Information, launcher.GlobalOptions.LogLevel);
var launcher = Assert.IsExactInstanceOfType<AspireHostLauncher>(AspireLauncher.TryCreate(args));
Assert.AreEqual("sdk", launcher.EnvironmentOptions.SdkDirectory);
Assert.IsTrue(launcher.EntryPoint.IsProjectFile);
Assert.AreEqual("myproject.csproj", launcher.EntryPoint.PhysicalPath);
Assert.IsEmpty(launcher.ApplicationArguments);
Assert.AreEqual(LogLevel.Information, launcher.GlobalOptions.LogLevel);
}

[Fact]
[TestMethod]
public void FilePath()
{
var args = new[] { "host", "--sdk", "sdk", "--entrypoint", "file.cs" };
var launcher = Assert.IsType<AspireHostLauncher>(AspireLauncher.TryCreate(args));
Assert.Equal("sdk", launcher.EnvironmentOptions.SdkDirectory);
Assert.False(launcher.EntryPoint.IsProjectFile);
Assert.Equal("file.cs", launcher.EntryPoint.EntryPointFilePath);
Assert.Empty(launcher.ApplicationArguments);
Assert.Equal(LogLevel.Information, launcher.GlobalOptions.LogLevel);
var launcher = Assert.IsExactInstanceOfType<AspireHostLauncher>(AspireLauncher.TryCreate(args));
Assert.AreEqual("sdk", launcher.EnvironmentOptions.SdkDirectory);
Assert.IsFalse(launcher.EntryPoint.IsProjectFile);
Assert.AreEqual("file.cs", launcher.EntryPoint.EntryPointFilePath);
Assert.IsEmpty(launcher.ApplicationArguments);
Assert.AreEqual(LogLevel.Information, launcher.GlobalOptions.LogLevel);
}

[Fact]
[TestMethod]
public void ApplicationArguments()
{
var args = new[] { "host", "--sdk", "sdk", "--entrypoint", "proj", "--verbose", "a", "b" };
var launcher = Assert.IsType<AspireHostLauncher>(AspireLauncher.TryCreate(args));
AssertEx.SequenceEqual(["a", "b"], launcher.ApplicationArguments);
Assert.Equal(LogLevel.Debug, launcher.GlobalOptions.LogLevel);
var launcher = Assert.IsExactInstanceOfType<AspireHostLauncher>(AspireLauncher.TryCreate(args));
Assert.AreSequenceEqual(["a", "b"], launcher.ApplicationArguments);
Assert.AreEqual(LogLevel.Debug, launcher.GlobalOptions.LogLevel);
}

[Fact]
[TestMethod]
public void VerboseOption()
{
// With verbose flag
var argsVerbose = new[] { "host", "--sdk", "sdk", "--entrypoint", "proj", "--verbose" };
var launcherVerbose = Assert.IsType<AspireHostLauncher>(AspireLauncher.TryCreate(argsVerbose));
Assert.Equal(LogLevel.Debug, launcherVerbose.GlobalOptions.LogLevel);
var launcherVerbose = Assert.IsExactInstanceOfType<AspireHostLauncher>(AspireLauncher.TryCreate(argsVerbose));
Assert.AreEqual(LogLevel.Debug, launcherVerbose.GlobalOptions.LogLevel);

// Without verbose flag
var argsNotVerbose = new[] { "host", "--sdk", "sdk", "--entrypoint", "proj" };
var launcherNotVerbose = Assert.IsType<AspireHostLauncher>(AspireLauncher.TryCreate(argsNotVerbose));
Assert.Equal(LogLevel.Information, launcherNotVerbose.GlobalOptions.LogLevel);
var launcherNotVerbose = Assert.IsExactInstanceOfType<AspireHostLauncher>(AspireLauncher.TryCreate(argsNotVerbose));
Assert.AreEqual(LogLevel.Information, launcherNotVerbose.GlobalOptions.LogLevel);
}

[Fact]
[TestMethod]
public void QuietOption()
{
// With quiet flag
var argsQuiet = new[] { "host", "--sdk", "sdk", "--entrypoint", "proj", "--quiet" };
var launcherQuiet = Assert.IsType<AspireHostLauncher>(AspireLauncher.TryCreate(argsQuiet));
Assert.Equal(LogLevel.Warning, launcherQuiet.GlobalOptions.LogLevel);
var launcherQuiet = Assert.IsExactInstanceOfType<AspireHostLauncher>(AspireLauncher.TryCreate(argsQuiet));
Assert.AreEqual(LogLevel.Warning, launcherQuiet.GlobalOptions.LogLevel);

// Without quiet flag
var argsNotQuiet = new[] { "host", "--sdk", "sdk", "--entrypoint", "proj" };
var launcherNotQuiet = Assert.IsType<AspireHostLauncher>(AspireLauncher.TryCreate(argsNotQuiet));
Assert.Equal(LogLevel.Information, launcherNotQuiet.GlobalOptions.LogLevel);
var launcherNotQuiet = Assert.IsExactInstanceOfType<AspireHostLauncher>(AspireLauncher.TryCreate(argsNotQuiet));
Assert.AreEqual(LogLevel.Information, launcherNotQuiet.GlobalOptions.LogLevel);
}

[Fact]
[TestMethod]
public void NoLaunchProfileOption()
{
// With no-launch-profile flag
var argsNoProfile = new[] { "host", "--sdk", "sdk", "--entrypoint", "proj", "--no-launch-profile" };
var launcherNoProfile = Assert.IsType<AspireHostLauncher>(AspireLauncher.TryCreate(argsNoProfile));
Assert.False(launcherNoProfile.LaunchProfileName.HasValue);
var launcherNoProfile = Assert.IsExactInstanceOfType<AspireHostLauncher>(AspireLauncher.TryCreate(argsNoProfile));
Assert.IsFalse(launcherNoProfile.LaunchProfileName.HasValue);

// Without no-launch-profile flag
var argsDefault = new[] { "host", "--sdk", "sdk", "--entrypoint", "proj" };
var launcherDefault = Assert.IsType<AspireHostLauncher>(AspireLauncher.TryCreate(argsDefault));
Assert.True(launcherDefault.LaunchProfileName.HasValue);
Assert.Null(launcherDefault.LaunchProfileName.Value);
var launcherDefault = Assert.IsExactInstanceOfType<AspireHostLauncher>(AspireLauncher.TryCreate(argsDefault));
Assert.IsTrue(launcherDefault.LaunchProfileName.HasValue);
Assert.IsNull(launcherDefault.LaunchProfileName.Value);
}

[Fact]
[TestMethod]
public void LaunchProfileOption()
{
var args = new[] { "host", "--sdk", "sdk", "--entrypoint", "proj", "--launch-profile", "MyProfile" };
var launcher = Assert.IsType<AspireHostLauncher>(AspireLauncher.TryCreate(args));
Assert.True(launcher.LaunchProfileName.HasValue);
Assert.Equal("MyProfile", launcher.LaunchProfileName.Value);
var launcher = Assert.IsExactInstanceOfType<AspireHostLauncher>(AspireLauncher.TryCreate(args));
Assert.IsTrue(launcher.LaunchProfileName.HasValue);
Assert.AreEqual("MyProfile", launcher.LaunchProfileName.Value);
}

[Fact]
[TestMethod]
public void ConflictingOptions()
{
// Cannot specify both --quiet and --verbose
var args = new[] { "host", "--sdk", "sdk", "--entrypoint", "proj", "--quiet", "--verbose" };
var launcher = AspireLauncher.TryCreate(args);
Assert.Null(launcher);
Assert.IsNull(launcher);
}

[Fact]
[TestMethod]
public void EntryPoint_MultipleValues()
{
// EntryPoint option should only accept one value; extra values become application arguments
var args = new[] { "host", "--sdk", "sdk", "--entrypoint", "proj1", "proj2" };
var launcher = Assert.IsType<AspireHostLauncher>(AspireLauncher.TryCreate(args));
Assert.Equal("proj1", launcher.EntryPoint.ProjectOrEntryPointFilePath);
AssertEx.SequenceEqual(["proj2"], launcher.ApplicationArguments);
var launcher = Assert.IsExactInstanceOfType<AspireHostLauncher>(AspireLauncher.TryCreate(args));
Assert.AreEqual("proj1", launcher.EntryPoint.ProjectOrEntryPointFilePath);
Assert.AreSequenceEqual(["proj2"], launcher.ApplicationArguments);
}

[Fact]
[TestMethod]
public void AllOptionsSet()
{
var args = new[] { "host", "--sdk", "sdk", "--entrypoint", "myapp.csproj", "--verbose", "--no-launch-profile", "arg1", "arg2", "arg3" };
var launcher = Assert.IsType<AspireHostLauncher>(AspireLauncher.TryCreate(args));

Assert.True(launcher.EntryPoint.IsProjectFile);
Assert.Equal("myapp.csproj", launcher.EntryPoint.PhysicalPath);
Assert.Equal("sdk", launcher.EnvironmentOptions.SdkDirectory);
Assert.Equal(LogLevel.Debug, launcher.GlobalOptions.LogLevel);
Assert.False(launcher.LaunchProfileName.HasValue);
AssertEx.SequenceEqual(["arg1", "arg2", "arg3"], launcher.ApplicationArguments);
var launcher = Assert.IsExactInstanceOfType<AspireHostLauncher>(AspireLauncher.TryCreate(args));

Assert.IsTrue(launcher.EntryPoint.IsProjectFile);
Assert.AreEqual("myapp.csproj", launcher.EntryPoint.PhysicalPath);
Assert.AreEqual("sdk", launcher.EnvironmentOptions.SdkDirectory);
Assert.AreEqual(LogLevel.Debug, launcher.GlobalOptions.LogLevel);
Assert.IsFalse(launcher.LaunchProfileName.HasValue);
Assert.AreSequenceEqual(["arg1", "arg2", "arg3"], launcher.ApplicationArguments);
}
}
}
Loading
Loading