Skip to content
0.2.0-dev Download ZIP
27 lines ·751 B Raw
1using EvilEngine.Adapters.Source.Maps;
2
3namespace EvilEngine.Adapters.Tests;
4
5public sealed class SourcePropLightTests
6{
7 [Theory]
8 [InlineData(0, 0)]
9 [InlineData(255, 4.594793)]
10 [InlineData(128, 1.0)]
11 [InlineData(30, 0.0415)]
12 public void ReadsAStoredByteAsTwiceItInGammaSpace(byte stored, double linear)
13 {
14 Assert.Equal(linear, SourcePropLight.Linear(stored), 0.01);
15 }
16
17 [Theory]
18 [InlineData("props/0/light", 0)]
19 [InlineData("props/181/light", 181)]
20 [InlineData("props/01/light", null)]
21 [InlineData("props/-1/light", null)]
22 [InlineData("props/3", null)]
23 public void NamesAPropsLightByItsIndex(string part, int? prop)
24 {
25 Assert.Equal(prop, SourcePropLight.Prop(part));
26 }
27}