示例#1
0
        public void GDID_RequiredRow_2()
        {
            var row = new NullableGDIDRow();
            var err = row.Validate();

            Assert.IsNotNull(err);
            Assert.IsInstanceOf <CRUDFieldValidationException>(err);
            Assert.AreEqual("GDID", ((CRUDFieldValidationException)err).FieldName);

            row.GDID = new GDID(1, 1, 1);
            err      = row.Validate();

            Assert.IsNull(err);

            row.GDID = GDID.Zero;
            err      = row.Validate();

            Assert.IsNotNull(err);
            Assert.IsInstanceOf <CRUDFieldValidationException>(err);
            Assert.AreEqual("GDID", ((CRUDFieldValidationException)err).FieldName);

            row.GDID = null;//Nullable
            err      = row.Validate();

            Assert.IsNotNull(err);
            Assert.IsInstanceOf <CRUDFieldValidationException>(err);
            Assert.AreEqual("GDID", ((CRUDFieldValidationException)err).FieldName);
        }
示例#2
0
        public void GDID_RequiredRow_2()
        {
            var row = new NullableGDIDRow();
            var err = row.Validate();

            Aver.IsNotNull(err);
            Aver.IsTrue(err is FieldValidationException);
            Aver.AreEqual("GDID", ((FieldValidationException)err).FieldName);

            row.GDID = new GDID(1, 1, 1);
            err      = row.Validate();

            Aver.IsNull(err);

            row.GDID = GDID.ZERO;
            err      = row.Validate();

            Aver.IsNotNull(err);
            Aver.IsTrue(err is FieldValidationException);
            Aver.AreEqual("GDID", ((FieldValidationException)err).FieldName);

            row.GDID = null;//Nullable
            err      = row.Validate();

            Aver.IsNotNull(err);
            Aver.IsTrue(err is FieldValidationException);
            Aver.AreEqual("GDID", ((FieldValidationException)err).FieldName);
        }
示例#3
0
文件: GDIDTest.cs 项目: itadapter/nfx
        public void GDID_RequiredRow_2()
        {
            var row = new NullableGDIDRow();
            var err = row.Validate();

            Assert.IsNotNull(err);
            Assert.IsInstanceOf<CRUDFieldValidationException>(err);
            Assert.AreEqual("GDID", ((CRUDFieldValidationException)err).FieldName);

            row.GDID = new GDID(1,1,1);
            err = row.Validate();

            Assert.IsNull(err);

            row.GDID = GDID.Zero;
            err = row.Validate();

            Assert.IsNotNull(err);
            Assert.IsInstanceOf<CRUDFieldValidationException>(err);
            Assert.AreEqual("GDID", ((CRUDFieldValidationException)err).FieldName);

            row.GDID = null;//Nullable
            err = row.Validate();

            Assert.IsNotNull(err);
            Assert.IsInstanceOf<CRUDFieldValidationException>(err);
            Assert.AreEqual("GDID", ((CRUDFieldValidationException)err).FieldName);
        }