我最近一直在进行单元测试,并且使用MOQ框架和MS Test成功地模拟了各种场景.我知道我们不能测试私有方法,但我想知道我们是否可以使用MOQ模拟静态方法.
在应用内容安全策略后,在 angular 应用程序的 index.html 文件中,应用程序给出了“unsafe-eval”控制台错误,如下所示 -
core.js:4442 ERROR Error: Uncaught (in promise): EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "default-src 'self'".
EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "default-src 'self'".
at new Function (<anonymous>)
at JitEvaluator.evaluateCode (compiler.js:6740)
at JitEvaluator.evaluateStatements (compiler.js:6714)
at CompilerFacadeImpl.jitExpression (compiler.js:19300)
at CompilerFacadeImpl.compileNgModule (compiler.js:19238) …Run Code Online (Sandbox Code Playgroud) ivy content-security-policy angular angular-compiler angular-jit
在 Oracle SQL Developer 中,当我打开任何数据库的树视图并查看其中的所有表时,它会自动获取所选表的定义。那么当我选择一张桌子时如何避免这个功能。我的意思是模拟 SQL Server DB IDE 的功能,其中当我们选择一个表时,它不会执行特定于它的操作,而只是进行导航。