/
githubmirror
/
roslyn
Обзор
Документация
Войти
/
githubmirror
/
roslyn
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/EditorFeatures/CSharpTest/StringCopyPaste/PasteUnknownSourceIntoNormalStringTests.cs
123 строки
3 KB
Cyrus Najmabadi
Cleanup test methods
24 июл 2025, 11:15
24 июл 2025, 11:15
9b3e554
Код
Авторство
О чём код?
// 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. using Roslyn.Test.Utilities; namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.StringCopyPaste; public sealed class PasteUnknownSourceIntoNormalStringTests : StringCopyPasteCommandHandlerUnknownSourceTests { [WpfFact] public void TestNewLineIntoNormalString1() => TestPasteUnknownSource( pasteText: "\n", """ var x = "[||]" """, """ var x = "\n[||]" """, afterUndo: "var x = \"\n[||]\""); [WpfFact] public void TestNewLineIntoNormalString2() => TestPasteUnknownSource( pasteText: """ """, """ var x = "[||]" """, """ var x = "\r\n[||]" """, afterUndo: """ var x = " [||]" """); [WpfFact] public void TestTabIntoNormalString1() => TestPasteUnknownSource( pasteText: "\t", """ var x = "[||]" """, """ var x = "\t[||]" """, afterUndo: "var x = \"\t[||]\""); [WpfFact] public void TestBackslashTIntoNormalString1() => TestPasteUnknownSource( pasteText: """\t""", """ var x = "[||]" """, """ var x = "\t[||]" """, afterUndo: """ var x = "[||]" """); [WpfFact] public void TestSingleQuoteIntoNormalString() => TestPasteUnknownSource( pasteText: """'""", """ var x = "[||]" """, """ var x = "'[||]" """, afterUndo: """ var x = "[||]" """); [WpfFact] public void TestDoubleQuoteIntoNormalString() => TestPasteUnknownSource( pasteText: """ " """, """ var x = "[||]" """, """ var x = "\"[||]" """, afterUndo: """ var x = ""[||]" """); [WpfFact] public void TestComplexStringIntoNormalString() => TestPasteUnknownSource( pasteText: "\t\"\"\t", """ var x = "[||]" """, """ var x = "\t\"\"\t[||]" """, afterUndo: "var x = \"\t\"\"\t[||]\""); [WpfFact] public void TestNormalTextIntoNormalString() => TestPasteUnknownSource( pasteText: """abc""", """ var x = "[||]" """, """ var x = "abc[||]" """, afterUndo: """ var x = "[||]" """); }