/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Scripting/CoreTestUtilities/ObjectFormatterTestBase.cs
42 строки
2 KB
Cyrus Najmabadi
Remove unused usings
18 июн 2025, 22:17
18 июн 2025, 22:17
481c36c
Код
Авторство
О чём код?
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #nullable disable using System; using Xunit; namespace Microsoft.CodeAnalysis.Scripting.Hosting.UnitTests { public abstract class ObjectFormatterTestBase { protected static PrintOptions SingleLineOptions => new PrintOptions { MemberDisplayFormat = MemberDisplayFormat.SingleLine }; protected static PrintOptions SeparateLinesOptions => new PrintOptions { MemberDisplayFormat = MemberDisplayFormat.SeparateLines, MaximumOutputLength = int.MaxValue }; protected static PrintOptions HiddenOptions => new PrintOptions { MemberDisplayFormat = MemberDisplayFormat.Hidden }; public void AssertMembers(string str, params string[] expected) { int i = 0; foreach (var line in str.Split(new[] { Environment.NewLine + " " }, StringSplitOptions.None)) { if (i == 0) { Assert.Equal(expected[i] + " {", line); } else if (i == expected.Length - 1) { Assert.Equal(expected[i] + Environment.NewLine + "}" + Environment.NewLine, line); } else { Assert.Equal(expected[i] + ",", line); } i++; } Assert.Equal(expected.Length, i); } } }