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()); }
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()); }
public void NotCorrectCharInPhone() { string[] items = new string[] { "", "Novak", "7054251237", "", "123456789", "987ghu21", "98x99v321" }; Assert.IsNull(ContactImporter.ParseLineToContactDTO(items, 4)); }
public void NotCorrectCharInBirthNumber() { string[] items = new string[] { "", "Novak", "7054f51237", "", "123456789", "987654321", "987456321" }; Assert.IsNull(ContactImporter.ParseLineToContactDTO(items, 4)); }