public void UTSignalHelperAbsoluteToRelativePosition4()
 {
     Assert.AreEqual(
         SignalHelper.AbsoluteToRelativePosition(2, 4, 6),
         4
         );
     Assert.AreEqual(
         SignalHelper.AbsoluteToRelativePosition(4, -4, 6),
         2
         );
     Assert.AreEqual(
         SignalHelper.AbsoluteToRelativePosition(-10, 4, 6),
         4
         );
     Assert.AreEqual(
         SignalHelper.AbsoluteToRelativePosition(18, 6, 6),
         0
         );
 }
 public void UTSignalHelperAbsoluteToRelativePosition3()
 {
     Assert.AreEqual(
         SignalHelper.AbsoluteToRelativePosition(2, loopLength: 6),
         2
         );
     Assert.AreEqual(
         SignalHelper.AbsoluteToRelativePosition(4, loopLength: 3),
         1
         );
     Assert.AreEqual(
         SignalHelper.AbsoluteToRelativePosition(-10, loopLength: 6),
         2
         );
     Assert.AreEqual(
         SignalHelper.AbsoluteToRelativePosition(12, 0, 6),
         0
         );
 }
 public void UTSignalHelperAbsoluteToRelativePosition1()
 {
     Assert.AreEqual(
         SignalHelper.AbsoluteToRelativePosition(2),
         2
         );
     Assert.AreEqual(
         SignalHelper.AbsoluteToRelativePosition(4, 0),
         4
         );
     Assert.AreEqual(
         SignalHelper.AbsoluteToRelativePosition(8, 0),
         8
         );
     Assert.AreEqual(
         SignalHelper.AbsoluteToRelativePosition(12, 0, 0),
         12
         );
 }
 public void UTSignalHelperAbsoluteToRelativePosition2()
 {
     Assert.AreEqual(
         SignalHelper.AbsoluteToRelativePosition(2, 2),
         0
         );
     Assert.AreEqual(
         SignalHelper.AbsoluteToRelativePosition(4, 3),
         1
         );
     Assert.AreEqual(
         SignalHelper.AbsoluteToRelativePosition(8, 10),
         -2
         );
     Assert.AreEqual(
         SignalHelper.AbsoluteToRelativePosition(12, 6, 0),
         6
         );
 }
示例#5
0
        //al hacer miVariable = Wave.Offset ejecutamos get
        //al hacer Wave.Offset = 5 ejecutamos set
        //ENDOF Implementación ISignalContent

        //Implementación ISignalHandler
        bool ISignalHandler.HasValuesAt(int position, uint loopLength, bool recursive)
        {
            //return true if this value's individual offset equals target position
            return(SignalHelper.AbsoluteToRelativePosition(position, _offset, loopLength) == 0);
        }