Example #1
0
        public void InRangeTests()
        {
            Clamp.Value((float)10.5, (float)10, (float)100).ShouldBe((float)10.5);

            Clamp.Value((float)11.1, (float)10, (float)100).ShouldBe((float)11.1);

            Clamp.Value((float)99, (float)10, (float)100).ShouldBe((float)99);

            Clamp.Value((float)100, (float)10, (float)100).ShouldBe((float)100);
        }
Example #2
0
        public void SameMinMaxTests()  // Make sure we apply minimum
        {
            Clamp.Value((float)0, (float)0, (float)0).ShouldBe((float)0);

            Clamp.Value((float)1, (float)0, (float)0).ShouldBe((float)0);

            Clamp.Value((float)0, (float)1, (float)1).ShouldBe((float)1);

            Clamp.Value((float)1, (float)1, (float)1).ShouldBe((float)1);
        }
Example #3
0
        public void InRangeTests()
        {
            Clamp.Value((uint)10, (uint)10, (uint)100).ShouldBe((uint)10);

            Clamp.Value((uint)11, (uint)10, (uint)100).ShouldBe((uint)11);

            Clamp.Value((uint)99, (uint)10, (uint)100).ShouldBe((uint)99);

            Clamp.Value((uint)100, (uint)10, (uint)100).ShouldBe((uint)100);
        }
Example #4
0
 public void InvalidMinMaxTests()
 {
     Should.Throw <ArgumentOutOfRangeException>(() => Clamp.Value((float)10, (float)100, (float)1));
 }
Example #5
0
 public void MaxTests()
 {
     Clamp.Value((float)101, (float)10, (float)100).ShouldBe((float)100);
 }
Example #6
0
 public void MinTests()  // Make sure we apply minimum
 {
     Clamp.Value((float)1, (float)10.1, (float)100).ShouldBe((float)10.1);
 }
Example #7
0
 public void MinTests()  // Make sure we apply minimum
 {
     Clamp.Value((uint)1, (uint)10, (uint)100).ShouldBe((uint)10);
 }