Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 0 additions & 13 deletions test/ArgumentsReflector/ArgumentsReflector.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,4 @@
<OutputType>Exe</OutputType>
</PropertyGroup>

<!-- Global usings removal -->
<!-- See: https://learn.microsoft.com/dotnet/core/project-sdk/msbuild-props#using -->
<ItemGroup>
<Using Remove="AwesomeAssertions" />
<Using Remove="Microsoft.NET.TestFramework" />
<Using Remove="Microsoft.NET.TestFramework.Assertions" />
<Using Remove="Microsoft.NET.TestFramework.Commands" />
<Using Remove="Microsoft.NET.TestFramework.ProjectConstruction" />
<Using Remove="Microsoft.NET.TestFramework.Utilities" />
<Using Remove="Xunit" />
<Using Remove="Xunit.Abstractions" />
</ItemGroup>

</Project>
17 changes: 0 additions & 17 deletions test/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,4 @@
<IncludeSymbols>false</IncludeSymbols>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="AwesomeAssertions" />
</ItemGroup>

<!-- Global usings -->
<!-- See: https://learn.microsoft.com/dotnet/core/project-sdk/msbuild-props#using -->
<ItemGroup>
<Using Include="FluentAssertions" />
<Using Include="Microsoft.NET.TestFramework" />
<Using Include="Microsoft.NET.TestFramework.Assertions" />
<Using Include="Microsoft.NET.TestFramework.Commands" />
<Using Include="Microsoft.NET.TestFramework.ProjectConstruction" />
<Using Include="Microsoft.NET.TestFramework.Utilities" />
<Using Include="Xunit" />
<Using Include="Xunit.Abstractions" />
</ItemGroup>

</Project>
11 changes: 11 additions & 0 deletions test/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@
<NoDefaultExcludes>true</NoDefaultExcludes>
</PropertyGroup>

<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<Using Include="FluentAssertions" />
<Using Include="Microsoft.NET.TestFramework" />
<Using Include="Microsoft.NET.TestFramework.Assertions" />
<Using Include="Microsoft.NET.TestFramework.Commands" />
<Using Include="Microsoft.NET.TestFramework.ProjectConstruction" />
<Using Include="Microsoft.NET.TestFramework.Utilities" />
<Using Include="Xunit" />
<Using Include="Xunit.Abstractions" />
</ItemGroup>

<ItemGroup Condition="'$(IsTestProject)' == 'true' AND '$(OutputType)' == 'Exe' AND '$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<Compile Include="$(MSBuildThisFileDirectory)Common\Program.cs" />
</ItemGroup>
Expand Down
13 changes: 0 additions & 13 deletions test/HelixTasks/HelixTasks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,4 @@
<PackageReference Include="System.Reflection.Metadata" VersionOverride="$(SystemReflectionMetadataToolsetPackageVersion)" />
</ItemGroup>

<!-- Global usings removal -->
<!-- See: https://learn.microsoft.com/dotnet/core/project-sdk/msbuild-props#using -->
<ItemGroup>
<Using Remove="AwesomeAssertions" />
<Using Remove="Microsoft.NET.TestFramework" />
<Using Remove="Microsoft.NET.TestFramework.Assertions" />
<Using Remove="Microsoft.NET.TestFramework.Commands" />
<Using Remove="Microsoft.NET.TestFramework.ProjectConstruction" />
<Using Remove="Microsoft.NET.TestFramework.Utilities" />
<Using Remove="Xunit" />
<Using Remove="Xunit.Abstractions" />
</ItemGroup>

</Project>
1 change: 1 addition & 0 deletions test/Microsoft.DotNet.HotReload.Test.Utilities/AssertEx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using System.Collections;
using System.Diagnostics;
using System.Text.RegularExpressions;
using Xunit;
using Xunit.Sdk;

namespace Microsoft.DotNet.Watch.UnitTests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

using System.Diagnostics;
using System.Threading.Tasks.Dataflow;
using Microsoft.NET.TestFramework.Utilities;
using Xunit.Abstractions;

namespace Microsoft.DotNet.Watch.UnitTests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System.Diagnostics;
using System.Runtime.CompilerServices;
using Xunit.Abstractions;

namespace Microsoft.DotNet.Watch.UnitTests;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using Microsoft.NET.TestFramework;

namespace Microsoft.DotNet.Watch.UnitTests;

internal static class TestAssetExtensions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

using System.Collections.Immutable;
using Microsoft.Extensions.Logging;
using Xunit.Abstractions;

namespace Microsoft.DotNet.Watch.UnitTests;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.InternalAbstractions;
using Microsoft.Extensions.EnvironmentAbstractions;
using Microsoft.NET.TestFramework.Utilities;
using NuGet.Configuration;
using NuGet.Frameworks;
using NuGet.Versioning;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,17 @@
<PackageReference Include="Microsoft.Extensions.Logging" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="System.IO.Hashing" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.assert" />
<PackageReference Include="AwesomeAssertions" />

<Using Include="FluentAssertions" />
<Using Include="Microsoft.NET.TestFramework" />
<Using Include="Microsoft.NET.TestFramework.Assertions" />
<Using Include="Microsoft.NET.TestFramework.Commands" />
<Using Include="Microsoft.NET.TestFramework.ProjectConstruction" />
<Using Include="Microsoft.NET.TestFramework.Utilities" />
<Using Include="Xunit" />
<Using Include="Xunit.Abstractions" />
</ItemGroup>

<!-- Packages that are in-box for .NET Core, so we only need to reference them for .NET Framework -->
Expand Down
17 changes: 13 additions & 4 deletions test/SDDLTests/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ private static void WriteError(string message)
Console.ResetColor();
}

private static void Assert(bool condition, string message)
{
if (!condition)
{
WriteError(message);
Environment.Exit(-1);
}
}

/// <summary>
/// Extracts the owner, group and DACL (individual ACES) of the security descriptor.
/// </summary>
Expand Down Expand Up @@ -185,13 +194,13 @@ private static void VerifySecurityDescriptor(string sddlDescriptor, string expec
Console.WriteLine($"Verifying descriptor: {sddlDescriptor}");
(string owner, string group, IEnumerable<string> ACEs) d = GetDescriptorParts(sddlDescriptor);

Assert.True(expectedOwnerSID == d.owner, $"Expected owner SID to be {expectedOwnerSID}. Actual value: {d.owner}");
Assert.True(expectedGroupSID == d.group, $"Expected group SID to be {expectedGroupSID}. Actual value: {d.group}");
Assert.True(d.ACEs.Count() == expectedNumberOfACEsInDACL, $"Expected {expectedNumberOfACEsInDACL}. Actual: {d.ACEs.Count()}");
Assert(expectedOwnerSID == d.owner, $"Expected owner SID to be {expectedOwnerSID}. Actual value: {d.owner}");
Assert(expectedGroupSID == d.group, $"Expected group SID to be {expectedGroupSID}. Actual value: {d.group}");
Assert(d.ACEs.Count() == expectedNumberOfACEsInDACL, $"Expected {expectedNumberOfACEsInDACL}. Actual: {d.ACEs.Count()}");

foreach (string ace in expectedACEs)
{
Assert.True(d.ACEs.Contains(ace), $"Expected DACL to contain {ace}, but it did not.");
Assert(d.ACEs.Contains(ace), $"Expected DACL to contain {ace}, but it did not.");
}
}

Expand Down
15 changes: 0 additions & 15 deletions test/SDDLTests/SDDLTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,4 @@
<ProjectReference Include="..\..\src\Cli\Microsoft.DotNet.Cli.Utils\Microsoft.DotNet.Cli.Utils.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="xunit" />
</ItemGroup>

<!-- Global usings removal -->
<!-- See: https://learn.microsoft.com/dotnet/core/project-sdk/msbuild-props#using -->
<ItemGroup>
<Using Remove="FluentAssertions" />
<Using Remove="Microsoft.NET.TestFramework" />
<Using Remove="Microsoft.NET.TestFramework.Assertions" />
<Using Remove="Microsoft.NET.TestFramework.Commands" />
<Using Remove="Microsoft.NET.TestFramework.ProjectConstruction" />
<Using Remove="Microsoft.NET.TestFramework.Utilities" />
</ItemGroup>

</Project>
13 changes: 0 additions & 13 deletions test/TelemetryStdOutLogger/TelemetryStdOutLogger.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,6 @@
<PackageReference Include="Microsoft.Build.Utilities.Core" />
</ItemGroup>

<!-- Global usings removal -->
<!-- See: https://learn.microsoft.com/dotnet/core/project-sdk/msbuild-props#using -->
<ItemGroup>
<Using Remove="FluentAssertions" />
<Using Remove="Microsoft.NET.TestFramework" />
<Using Remove="Microsoft.NET.TestFramework.Assertions" />
<Using Remove="Microsoft.NET.TestFramework.Commands" />
<Using Remove="Microsoft.NET.TestFramework.ProjectConstruction" />
<Using Remove="Microsoft.NET.TestFramework.Utilities" />
<Using Remove="Xunit" />
<Using Remove="Xunit.Abstractions" />
</ItemGroup>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,4 @@
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<Using Remove="@(Using)"/>
</ItemGroup>
</Project>