예제 #1
0
            public void TestMutableArrayWithoutLength()
            {
                var structure = SchemaTestUtil.Parse(@"
namespace foo.bar {
  [BinarySchema]
  public partial class ArrayWrapper {
    public int[] field;
  }
}");

                SchemaTestUtil.AssertDiagnostics(structure.Diagnostics, Rules.MutableArrayNeedsLengthSource);
            }
        public void TestBooleanWithoutAltFormat()
        {
            var structure = SchemaTestUtil.Parse(@"
namespace foo.bar {
  [BinarySchema]
  public partial class BooleanWrapper {
    public bool field;
  }
}");

            SchemaTestUtil.AssertDiagnostics(structure.Diagnostics,
                                             Rules.BooleanNeedsIntegerFormat);
        }
            public void TestEnumWithoutFormat()
            {
                var structure = SchemaTestUtil.Parse(@"
namespace foo.bar {
  public enum ValueType {
    A,
    B,
    C
  }

  [BinarySchema]
  public partial class EnumWrapper {
    public ValueType field;
  }
}");

                SchemaTestUtil.AssertDiagnostics(structure.Diagnostics, Rules.EnumNeedsIntegerFormat);
            }