diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 16c40af..1aa7b34 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -11,6 +11,14 @@ ], "isBuildCommand": true, "problemMatcher": "$msCompile" + }, + { + "taskName": "test", + "args": [ + "${workspaceRoot}/Tests/Tests.csproj" + ], + "isTestCommand": true, + "problemMatcher": "$msCompile" } ] } \ No newline at end of file diff --git a/Ooui/Button.cs b/Ooui/Button.cs index b01a2f0..45c9279 100644 --- a/Ooui/Button.cs +++ b/Ooui/Button.cs @@ -15,5 +15,14 @@ namespace Ooui get => val; set => SetProperty (ref val, value, "value"); } + + public Button () + { + } + + public Button (string text) + { + Text = text; + } } } diff --git a/Ooui/TextNode.cs b/Ooui/TextNode.cs index a199bb3..9954790 100644 --- a/Ooui/TextNode.cs +++ b/Ooui/TextNode.cs @@ -11,7 +11,7 @@ namespace Ooui } public TextNode () - { + { } public TextNode (string text) diff --git a/Tests/ButtonTests.cs b/Tests/ButtonTests.cs index caa03a1..778d011 100644 --- a/Tests/ButtonTests.cs +++ b/Tests/ButtonTests.cs @@ -14,5 +14,12 @@ namespace Tests var b = new Button (); Assert.AreEqual ("", b.Text); } + + [TestMethod] + public void TextCtor () + { + var b = new Button ("Hello World!"); + Assert.AreEqual ("Hello World!", b.Text); + } } }