You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.9 KiB
58 lines
1.9 KiB
using NUnit.Framework;
|
|
|
|
namespace UnityEngine.Rendering.HighDefinition.Tests
|
|
{
|
|
class ScalableSettingSchemaTests
|
|
{
|
|
[Test]
|
|
public void LevelNamesWorks()
|
|
{
|
|
var schema = ScalableSettingSchema.GetSchemaOrNull(ScalableSettingSchemaId.With3Levels);
|
|
|
|
Assert.AreEqual(3, schema.levelCount);
|
|
Assert.AreEqual(3, schema.levelNames.Length);
|
|
Assert.AreEqual("Low", schema.levelNames[0].text);
|
|
Assert.AreEqual("Medium", schema.levelNames[1].text);
|
|
Assert.AreEqual("High", schema.levelNames[2].text);
|
|
}
|
|
|
|
[Test]
|
|
public void GetSchemaOrNullWorks()
|
|
{
|
|
{
|
|
var schema = ScalableSettingSchema.GetSchemaOrNull(ScalableSettingSchemaId.With3Levels);
|
|
|
|
Assert.IsNotNull(schema);
|
|
Assert.AreEqual(3, schema.levelCount);
|
|
Assert.AreEqual(3, schema.levelNames.Length);
|
|
}
|
|
{
|
|
ScalableSettingSchemaId? id = ScalableSettingSchemaId.With3Levels;
|
|
var schema = ScalableSettingSchema.GetSchemaOrNull(id);
|
|
|
|
Assert.IsNotNull(schema);
|
|
Assert.AreEqual(3, schema.levelCount);
|
|
Assert.AreEqual(3, schema.levelNames.Length);
|
|
}
|
|
}
|
|
|
|
[Test]
|
|
public void GetSchemaOrNull_ReturnsNullWhenMissing()
|
|
{
|
|
{
|
|
var schema = ScalableSettingSchema.GetSchemaOrNull(default);
|
|
Assert.IsNull(schema);
|
|
}
|
|
{
|
|
ScalableSettingSchemaId? id = default;
|
|
var schema = ScalableSettingSchema.GetSchemaOrNull(id);
|
|
Assert.IsNull(schema);
|
|
}
|
|
{
|
|
ScalableSettingSchemaId? id = null;
|
|
var schema = ScalableSettingSchema.GetSchemaOrNull(id);
|
|
Assert.IsNull(schema);
|
|
}
|
|
}
|
|
}
|
|
}
|