Move NoAssertContext to Core test utilities (#12621)

This will allow it to be used in WPF as well.
This commit is contained in:
Jeremy Kuhne 2024-12-10 15:54:16 -08:00 коммит произвёл GitHub
Родитель 0773d890f7
Коммит 516ddf1f87
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
5 изменённых файлов: 4 добавлений и 8 удалений

Просмотреть файл

@ -1,5 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
global using System.Diagnostics;
global using System.Diagnostics.CodeAnalysis;
global using Xunit;

Просмотреть файл

@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics;
using System.Runtime.CompilerServices;
namespace System;

Просмотреть файл

@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
#nullable enable
using System.Collections.Concurrent;
namespace System;

Просмотреть файл

@ -1,8 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Diagnostics;
namespace System;
public sealed class ThrowingTraceListener : TraceListener
@ -12,8 +10,9 @@ public sealed class ThrowingTraceListener : TraceListener
public override void Fail(string? message, string? detailMessage)
{
throw new InvalidOperationException(
(string.IsNullOrEmpty(message) ? "Assertion failed" : message) +
(string.IsNullOrEmpty(detailMessage) ? "" : Environment.NewLine + detailMessage));
$"{(string.IsNullOrEmpty(message) ? "Assertion failed" : message)}{(string.IsNullOrEmpty(detailMessage)
? ""
: $"{Environment.NewLine}{detailMessage}")}");
}
public override void Write(object? o)

Просмотреть файл

@ -1,7 +1,6 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
global using System.Diagnostics;
global using System.Diagnostics.CodeAnalysis;
global using Windows.Win32;
global using Windows.Win32.Foundation;