Reputation: 8531
I have a string resource that I'm using to set as the x:uid for a textblock
<data name="Expected.Text" xml:space="preserve">
<value>Expected Text</value>
</data>
<TextBlock x:Name="control" x:uid="Expected />
I'm trying to write a Unit test to check if the text is correct. However I can't get a handle on the "Expected" string because it has a .text at the end so that it can be displayed in the TextBlock
ResourceLoader loader = ResourceLoader.GetForCurrentView();
var expected = loader.GetString("Expected");
Assert.AreEqual(expected, control.Text);
This code fails because var expected is blank
Upvotes: 5
Views: 1681
Reputation: 3362
You can access that property via the following notation:
var expected = loader.GetString("Expected/Text");
Upvotes: 9