Пример #1
0
 public void TestMemberFn_ToString_i()
 {
     var testCase = new Bgra16();
     testCase.PackFrom(0.222f, 0.125f, 0.656f, 0.861f);
     String s = testCase.ToString ();
     Assert.That(s, Is.EqualTo("DA23"));
 }
Пример #2
0
 public void TestMemberFn_GetHashCode_i ()
 {
     HashSet<Int32> hs = new HashSet<Int32>();
     UInt16 packed = UInt16.MinValue;
     while ( packed < UInt16.MaxValue )
     {
         ++packed;
         var packedObj = new Bgra16();
         packedObj.PackedValue = packed;
         Int32 hc = packedObj.GetHashCode ();
         Assert.That(!hs.Contains(hc));
         hs.Add(hc);
     }
 }
Пример #3
0
 public void TestAllPossibleValues_i()
 {
     UInt16 packed = UInt16.MinValue;
     while ( packed < UInt16.MaxValue )
     {
         ++packed;
         var packedObj = new Bgra16();
         packedObj.PackedValue = packed;
         Single realB, realG, realR, realA = 0f;
         packedObj.UnpackTo(out realB, out realG, out realR, out realA);
         var newPackedObj = new Bgra16(realB, realG, realR, realA);
         Assert.That(newPackedObj.PackedValue, Is.EqualTo(packed));
     }
 }