我有这个:
<Image.Effect>
<fx:GrayscaleEffect DesaturationFactor="0"/>
</Image.Effect>
和这个:
public class GrayscaleEffect : ShaderEffect{
private static PixelShader _pixelShader = new PixelShader()
{
UriSource = new Uri(@"pack://application:,,,/Effects/GrayscaleEffect.ps")
};
/* ... rest of the class ... */
}
当我对它进行MSTest
单元测试时IOException
(Application.Current
pack://application:,,,/...
Assembly.GetEntryAssembly() returns null. Set the Application.ResourceAssembly property or use the pack://application:,,,/assemblyname;component/ syntax to specify the assembly to load the resource from.
我如何模拟/注入解决它所需的任何东西?