Remove NStack and replace ustring to string.

This commit is contained in:
BDisp
2023-05-07 18:16:52 +01:00
parent dea5f0fe03
commit 2a63ede8ba
145 changed files with 2800 additions and 2702 deletions

View File

@@ -7,7 +7,7 @@ using Terminal.Gui;
using Xunit;
using System.Globalization;
using Xunit.Abstractions;
using NStack;
using System.Text;
using static Terminal.Gui.Application;
namespace Terminal.Gui.DialogTests {
@@ -560,7 +560,7 @@ namespace Terminal.Gui.DialogTests {
// Note extra spaces to make dialog even wider
// 123456 123456
var buttonRow = $"{CM.Glyphs.VLine} {btn1} {btn2} {btn3} {btn4} {CM.Glyphs.VLine}";
var width = ustring.Make (buttonRow).ConsoleWidth;
var width = buttonRow.ConsoleWidth();
d.SetBufferSize (width, 3);
// Default - Center
@@ -570,21 +570,21 @@ namespace Terminal.Gui.DialogTests {
// Justify
buttonRow = $"{CM.Glyphs.VLine}{btn1} {btn2} {btn3} {btn4}{CM.Glyphs.VLine}";
Assert.Equal (width, ustring.Make (buttonRow).ConsoleWidth);
Assert.Equal (width, buttonRow.ConsoleWidth());
(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Justify, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text));
TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output);
Application.End (runstate);
// Right
buttonRow = $"{CM.Glyphs.VLine} {btn1} {btn2} {btn3} {btn4}{CM.Glyphs.VLine}";
Assert.Equal (width, ustring.Make (buttonRow).ConsoleWidth);
Assert.Equal (width, buttonRow.ConsoleWidth());
(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Right, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text));
TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output);
Application.End (runstate);
// Left
buttonRow = $"{CM.Glyphs.VLine}{btn1} {btn2} {btn3} {btn4} {CM.Glyphs.VLine}";
Assert.Equal (width, ustring.Make (buttonRow).ConsoleWidth);
Assert.Equal (width, buttonRow.ConsoleWidth());
(runstate, var _) = RunButtonTestDialog (title, width, Dialog.ButtonAlignments.Left, new Button (btn1Text), new Button (btn2Text), new Button (btn3Text), new Button (btn4Text));
TestHelpers.AssertDriverContentsWithFrameAre ($"{buttonRow}", output);
Application.End (runstate);

View File

@@ -7,7 +7,7 @@ using Terminal.Gui;
using Xunit;
using System.Globalization;
using Xunit.Abstractions;
using NStack;
using System.Text;
using static Terminal.Gui.Application;
namespace Terminal.Gui.DialogTests {
@@ -42,7 +42,7 @@ namespace Terminal.Gui.DialogTests {
public void WizardStep_Set_Title_Fires_TitleChanging ()
{
var r = new Window ();
Assert.Equal (ustring.Empty, r.Title);
Assert.Equal (string.Empty, r.Title);
string expectedAfter = string.Empty;
string expectedDuring = string.Empty;
@@ -70,7 +70,7 @@ namespace Terminal.Gui.DialogTests {
public void WizardStep_Set_Title_Fires_TitleChanged ()
{
var r = new Window ();
Assert.Equal (ustring.Empty, r.Title);
Assert.Equal (string.Empty, r.Title);
string expected = string.Empty;
r.TitleChanged += (s,args) => {