Beispiel #1
0
        public void DisplayFormat()
        {
            var row = new MyCar
            {
                Code   = "ABZ-01",
                Milage = 150000
            };

            Aver.AreEqual("150000", row["Milage"].ToString());
            Aver.AreEqual("Milage: 150,000 miles", row.GetDisplayFieldValue("Milage"));
        }
Beispiel #2
0
        public void FieldValueDescription()
        {
            var row = new MyCar();

            row.Sex = "F";
            Aver.AreEqual("Female", row.GetFieldValueDescription("Sex"));

            row.Sex = "M";
            Aver.AreEqual("Male", row.GetFieldValueDescription("Sex"));

            row.Sex = "U";
            Aver.AreEqual("Unknown", row.GetFieldValueDescription("Sex"));
        }
Beispiel #3
0
        public void ValidateRegexp()
        {
            var row = new MyCar
            {
                Code = "adsd"
            };

            var ve = row.Validate();

            Aver.IsNotNull(ve);
            Aver.IsTrue(ve.Message.Contains("Allowed characters: A-Z,0-9,-"));
            Console.WriteLine(ve.ToMessageWithType());

            row.Code = "AZ-90";
            ve       = row.Validate();
            Aver.IsNull(ve);
        }