示例#1
0
 public void ScalarData_RiseAndFallToEmpty_WithPreviousNullThrows()
 {
     Assert.ThrowsException <ArgumentException>(
         () =>
     {
         var result = ScalarData.ApplyRiseAndFallToEmpty(null, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(4));
     }
         );
 }
示例#2
0
        public void ScalarData_RiseAndFallToEmpty()
        {
            var data           = ScalarData.Create(new float[] { 1.0f, 0.0f, -1.0f });
            var result         = ScalarData.ApplyRiseAndFallToEmpty(data, TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(4));
            var expectedResult = new float[] {
                RiseFallTime(0, data[0], 0.25f, 0.5f),
                RiseFallTime(0, data[1], 0.25f, 0.5f),
                RiseFallTime(0, data[2], 0.25f, 0.5f)
            };

            AssertFloatCollectionsAreEqual(
                expectedResult,
                result.ToArray(), 0.001f, "Calculation results incorrect"
                );
        }