Beispiel #1
0
        public void Should_Populate_Special_Fields()
        {
            //Create a new instance of our test class
            var testInstance = new SpecialFieldsTestClass();

            //Match all of the fields on our test instance
            _matcher.Match(testInstance);

            /* Assert to see that we have populated all of the fields on our test instance */
            Assert.AreNotEqual(testInstance.UserID, default(int));
            Assert.AreNotEqual(testInstance.Timestamp, default(long));
            Assert.AreNotEqual(testInstance.DateRegistered, default(DateTime));

            Assert.IsNotNullOrEmpty(testInstance.Name);
            Assert.IsNotNullOrEmpty(testInstance.Email);
            Assert.IsTrue(_valid_email_regex.IsMatch(testInstance.Email));
        }
        public void Should_Populate_Special_Fields()
        {
            //Create a new instance of our test class
            var testInstance = new SpecialFieldsTestClass();

            //Match all of the fields on our test instance
            _matcher.Match(testInstance);

            /* Assert to see that we have populated all of the fields on our test instance */
            Assert.AreNotEqual(testInstance.UserID, default(int));
            Assert.AreNotEqual(testInstance.Timestamp, default(long));
            Assert.AreNotEqual(testInstance.DateRegistered, default(DateTime));

            Assert.IsNotNullOrEmpty(testInstance.Name);
            Assert.IsNotNullOrEmpty(testInstance.Email);
            Assert.IsTrue(_valid_email_regex.IsMatch(testInstance.Email));
        }