Esempio n. 1
0
        public void String_contain_first_name__expect__false_p_isnull()
        {
            var    teste = new PersonParser();
            Person p;
            var    result = teste.TryToParse("Johan", out p);

            Assert.AreEqual(false, result);
            Assert.IsNull(p);
        }
Esempio n. 2
0
        public void String_Empty__expect__false_p_isnull()
        {
            var    teste = new PersonParser();
            Person p;
            var    result = teste.TryToParse(string.Empty, out p);

            Assert.AreEqual(false, result);
            Assert.IsNull(p);
        }
Esempio n. 3
0
        public void String_contain_4_name__expect__true_p_firstname_middlename_and_lastname_contain_value_the_last_token_disgarded()
        {
            var    teste = new PersonParser();
            Person p;
            var    result = teste.TryToParse("johan sebastian max goris", out p);

            Assert.AreEqual(true, result);
            Assert.IsNotNull(p);
            Assert.AreEqual("johan", p.FirstName);
            Assert.AreEqual("sebastian", p.MiddleName);
            Assert.AreEqual("max", p.LastName);
        }
Esempio n. 4
0
        public void String_contain_2_name__expect__true_p_firstname_and_lastname_contain_value()
        {
            var    teste = new PersonParser();
            Person p;
            var    result = teste.TryToParse("johan sebastian", out p);

            Assert.AreEqual(true, result);
            Assert.IsNotNull(p);
            Assert.AreEqual("johan", p.FirstName);
            Assert.AreEqual("sebastian", p.LastName);
            Assert.AreEqual(string.Empty, p.MiddleName);
        }