public void DefaultConstructorCreatesAllZeros() { #pragma warning disable SA1129 // Do not use default value type constructor var v = new ReadOnlyFixedBytes(); #pragma warning restore SA1129 // Do not use default value type constructor var bytes = v.ToByteArray(); Assert.True(bytes.All(b => b == 0)); }
/// <summary> /// Gets the value packed in a byte array. /// </summary> public byte[] ToByteArray() { Contract.Requires(Length > 0); return(_bytes.ToByteArray(Length)); }