mirror of
https://github.com/abdelkader/vCardEditor
synced 2025-12-12 08:27:19 +07:00
added test to incorrect vcf file
This commit is contained in:
@@ -26,6 +26,18 @@ namespace vCardEditor_Test
|
||||
Assert.IsTrue(contacts.Count == 0);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void NewFileOpened_IncorrectVCF_Test()
|
||||
{
|
||||
var fileHandler = Substitute.For<IFileHandler>();
|
||||
fileHandler.ReadAllLines(Arg.Any<string>()).Returns(Entries.vcfIncorrect);
|
||||
var repo = Substitute.For<ContactRepository>(fileHandler);
|
||||
|
||||
var contacts = repo.LoadContacts("file.vcf");
|
||||
|
||||
Assert.IsTrue(contacts.Count == 0);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void NewFileOpened_Utf8Entry_Test()
|
||||
{
|
||||
|
||||
@@ -16,6 +16,14 @@ namespace vCardEditor_Test
|
||||
}
|
||||
}
|
||||
|
||||
public static string[] vcfIncorrect
|
||||
{
|
||||
get
|
||||
{
|
||||
return "abcdef".Split('\n');
|
||||
}
|
||||
}
|
||||
|
||||
public static string[] vcfOneEntry
|
||||
{
|
||||
get
|
||||
|
||||
Reference in New Issue
Block a user