Add Button text ctor

This commit is contained in:
Frank A. Krueger 2017-06-14 16:48:42 -07:00
parent d4eee234b2
commit 4c8c4e2b03
4 changed files with 25 additions and 1 deletions

8
.vscode/tasks.json vendored
View File

@ -11,6 +11,14 @@
], ],
"isBuildCommand": true, "isBuildCommand": true,
"problemMatcher": "$msCompile" "problemMatcher": "$msCompile"
},
{
"taskName": "test",
"args": [
"${workspaceRoot}/Tests/Tests.csproj"
],
"isTestCommand": true,
"problemMatcher": "$msCompile"
} }
] ]
} }

View File

@ -15,5 +15,14 @@ namespace Ooui
get => val; get => val;
set => SetProperty (ref val, value, "value"); set => SetProperty (ref val, value, "value");
} }
public Button ()
{
}
public Button (string text)
{
Text = text;
}
} }
} }

View File

@ -14,5 +14,12 @@ namespace Tests
var b = new Button (); var b = new Button ();
Assert.AreEqual ("", b.Text); Assert.AreEqual ("", b.Text);
} }
[TestMethod]
public void TextCtor ()
{
var b = new Button ("Hello World!");
Assert.AreEqual ("Hello World!", b.Text);
}
} }
} }