您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
31 行
923 B
31 行
923 B
using NUnit.Framework;
|
|
using UnityEngine.Experimental.Perception.Randomization.Samplers;
|
|
|
|
namespace RandomizationTests.SamplerTests
|
|
{
|
|
[TestFixture]
|
|
public class NormalSamplerTestsBase : SamplerTestsBase<NormalSampler>
|
|
{
|
|
public NormalSamplerTestsBase()
|
|
{
|
|
m_BaseSampler = new NormalSampler(-10f, 10f, 0f, 1f);
|
|
}
|
|
|
|
[Test]
|
|
public void SamplesInRange()
|
|
{
|
|
var samples = new float[k_TestSampleCount];
|
|
for (var i = 0; i < samples.Length; i++)
|
|
{
|
|
samples[i] = m_Sampler.Sample();
|
|
}
|
|
Assert.AreEqual(samples.Length, k_TestSampleCount);
|
|
|
|
for (var i = 0; i < samples.Length; i++)
|
|
{
|
|
Assert.GreaterOrEqual(samples[i], m_Sampler.range.minimum);
|
|
Assert.LessOrEqual(samples[i], m_Sampler.range.maximum);
|
|
}
|
|
}
|
|
}
|
|
}
|