public void GetDefinedCharacterBitmap_ReturnsSingletonInstance()
        {
            // Act
            uint[] retVal1 = UnicodeHelpers.GetDefinedCharacterBitmap();
            uint[] retVal2 = UnicodeHelpers.GetDefinedCharacterBitmap();

            // Assert
            Assert.Same(retVal1, retVal2);
        }
Exemple #2
0
 public void ForbidUndefinedCharacters()
 {
     // Forbid codepoints which aren't mapped to characters or which are otherwise always disallowed
     // (includes categories Cc, Cs, Co, Cn, Zs [except U+0020 SPACE], Zl, Zp)
     uint[] definedCharactersBitmap = UnicodeHelpers.GetDefinedCharacterBitmap();
     Debug.Assert(definedCharactersBitmap.Length == _allowedCharsBitmap.Length);
     for (int i = 0; i < _allowedCharsBitmap.Length; i++)
     {
         _allowedCharsBitmap[i] &= definedCharactersBitmap[i];
     }
 }