У меня есть простое окно со ссылкой на StaticResource в App.xaml.
Определение ресурса App.xaml:
<!-- Standard Text Box Style -->
<Style x:Key="textBoxStyleStd" TargetType="{x:Type TextBox}">
    <Setter Property="FontSize" Value="14" />
</Style>
Компоненты окна с использованием ресурса:
<TextBlock Grid.Column="1" Grid.Row="0" Name="stationIdTitle"
           Style="{StaticResource textBlockStyleStd}"
           VerticalAlignment="Center" HorizontalAlignment="Center"
           Text="{LocText Key=Title, Dict={StaticResource Dictionary},
               Assembly={StaticResource Assembly}}"/>
При попытке unit test в этом окне я получаю сообщение об ошибке:
System.Windows.Markup.XamlParseException: не удается найти ресурс с именем '{TextBlockStyleStd}'. Имена ресурсов чувствительны к регистру. Ошибка при object 'stationIdTitle' в файле разметки 'Zpg; компонент /guicomponenets/screens/enterstationidscreen.xaml' Line 23 Позиция 71.
Есть ли способ обойти это? Мой unit test код:
[Test]
public void TestEnterKeyPressedNoText()
{
    IPickingBusinessObject pickingBusinessObject = mock.StrictMock<IPickingBusinessObject>();
    EnterStationIdScreen objectUnderTest = new EnterStationIdScreen(pickingBusinessObject);
    Assert.AreEqual(Visibility.Visible, objectUnderTest.stationIdError.Visibility);
    Assert.AreEqual("werwe", "oksdf");
    Replay();
    objectUnderTest.EnterKeyPressed();
    Verify();
}
