小编Luk*_*tko的帖子

如何在Visual Studio中对Windows 10应用程序进行单元测试?

如何在Visual Studio 2015中对Windows 10应用程序进行单元测试?

I created a Blank App Universal Windows project and added a new Unit Test Project to the solution, but when I try to add a reference to my UWP app in the Test Project, I get an error saying 'Unable to add a reference to project "Project Name"'.

在此输入图像描述

unit-testing win-universal-app visual-studio-2015

18
推荐指数
2
解决办法
6100
查看次数

如何在JavaScript中使用负零字符串化JSON对象?

如何使用JSON.stringify将负零转换为字符串(-0)?似乎JSON.stringify将负零转换为表示正数的字符串.想要一个好的解决方法吗?

var jsn = {
    negative: -0
};
isNegative(jsn.negative) ? document.write("negative") : document.write("positive");
var jsonString = JSON.stringify(jsn),
    anotherJSON = JSON.parse(jsonString);
isNegative(anotherJSON.negative) ? document.write("negative") : document.write("positive");

function isNegative(a)
{
    if (0 !== a)
    {
        return !1;
    }
    var b = Object.freeze(
    {
        z: -0
    });
    try
    {
        Object.defineProperty(b, "z",
        {
            value: a
        });
    }
    catch (c)
    {
        return !1;
    }
    return !0;
}
Run Code Online (Sandbox Code Playgroud)

javascript json

6
推荐指数
1
解决办法
1403
查看次数