[Test] public void EnumBitMasks() { const string bitstr0 = "100100010100110010110"; var bits0 = Bit.Parse(bitstr0); var bitmasks = new[] { Bit.Parse("000000000000000000010"), Bit.Parse("000000000000000000100"), Bit.Parse("000000000000000010000"), Bit.Parse("000000000000010000000"), Bit.Parse("000000000000100000000"), Bit.Parse("000000000100000000000"), Bit.Parse("000000010000000000000"), Bit.Parse("000100000000000000000"), Bit.Parse("100000000000000000000") }; var masks = Bit.EnumBitMasks(bits0).ToArray(); Assert.True(bitmasks.SequenceEqual(masks)); }