Beispiel #1
0
        public void CorrectEmptyItems()
        {
            ContactDTO contact = new ContactDTO
            {
                Name         = "",
                Surname      = "Novak",
                Address      = "",
                BirthNumber  = 7054251237,
                PhoneNumbers = new int?[] { 123456789, 987654321, 987456321 }
            };

            string[] items = new string[] { "", "Novak", "7054251237", "", "123456789", "987654321", "987456321" };
            Assert.AreSame(contact.ToString(), ContactImporter.ParseLineToContactDTO(items, 4).ToString());
        }
Beispiel #2
0
        public void CorrectAllItems()
        {
            ContactDTO contact = new ContactDTO
            {
                Name         = "Jan",
                Surname      = "Novak",
                Address      = "a b 5",
                BirthNumber  = 7054251237,
                PhoneNumbers = new int?[] { 123456789, null, null }
            };

            string[] items = new string[] { "Jan", "Novak", "7054251237", "a b 5", "123456789" };
            Assert.AreSame(contact.ToString(), ContactImporter.ParseLineToContactDTO(items, 4).ToString());
        }
Beispiel #3
0
 public void NotCorrectCharInPhone()
 {
     string[] items = new string[] { "", "Novak", "7054251237", "", "123456789", "987ghu21", "98x99v321" };
     Assert.IsNull(ContactImporter.ParseLineToContactDTO(items, 4));
 }
Beispiel #4
0
 public void NotCorrectCharInBirthNumber()
 {
     string[] items = new string[] { "", "Novak", "7054f51237", "", "123456789", "987654321", "987456321" };
     Assert.IsNull(ContactImporter.ParseLineToContactDTO(items, 4));
 }