小编Bra*_*rad的帖子

在 Unity3d 测试脚本中,如何从另一个类调用静态函数?

我在 Unity3d 项目中有两个文件。一个是在编辑模式下运行的测试脚本。另一个是带有静态函数的单个类,我想从测试脚本中调用这些函数。

这是我的测试脚本:

using UnityEngine;
using UnityEngine.TestTools;
using NUnit.Framework;
using System.Collections;

public class NewTestScript 
{

    [Test]
    public void TestAnotherStaticFunction() 
    {
        int a = NewBehaviourScript.FunctionUnderTest(1);
        int b = 1;

        // Use the Assert class to test conditions.
        Assert.IsTrue(a == b);
    }
}
Run Code Online (Sandbox Code Playgroud)

这是我正在测试的功能:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NewBehaviourScript : MonoBehaviour 
{
    /// <summary>
    /// the stupidest function in the world, 
    /// used to verify tests.
    /// </summary>
    public static int FunctionUnderTest(int a)
    {
        return a;
    } …
Run Code Online (Sandbox Code Playgroud)

nunit unit-testing unity-game-engine

3
推荐指数
1
解决办法
3298
查看次数

如何找到通用 Azure API 连接支持的参数值?

我遇到了与此类似的问题。我正在尝试通过 ARM 模板部署 API 连接,但在部署时出现“ParameterNotDefined”错误。

但是,我没有创建到 azure 表的 API 连接,而是连接到 azure 队列。

我没有得到具体的答案,而是希望获得有关如何使用文档或其他方法自己回答这个问题的指导:我无法找到有关通过“MICROSOFT.WEB/CONNECTIONS”类型支持的现有 API 的文档,以及每个 API 期望您提供的相关“参数值”。

在此处搜索解决方案非常困难,因为术语非常多。这是我已经尝试过的:

  1. 我试过使用Azure Resource Explorer,但它看起来像浏览资源,而不是可用的 API。如果我可以使用它来查看 API,目前尚不清楚如何使用。
  2. 我浏览了 azure 快速入门项目上的示例。我看到了天蓝色 blob 的示例,但没有看到队列。
  3. 我在此页面上阅读了一些有关为逻辑应用程序创建 API 连接的文档。这看起来很相关,作者提到向“ https://management.azure.com/.../ ”发出 GET 请求以查看 API 详细信息,但在执行此操作时出现授权标头错误,我希望我能得到文档没有在堆栈上操作这个低。

在不久的将来,我将创建大量与逻辑应用程序的 API 连接,我需要一种比谷歌搜索、堆栈溢出和代码示例重用更复杂的发现方法。 我如何查看整套 API 连接,以及每个 API 连接所支持的“参数值”?

azure azure-resource-manager azure-logic-apps

2
推荐指数
1
解决办法
474
查看次数