-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We've added unit tests --- We've added unit tests for the MeCard functionality. --- Type: und Breaking: False Doc Required: False Part: 1/1
- Loading branch information
Showing
3 changed files
with
191 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,23 @@ namespace VisualCard.Tests | |
public static class ContactData | ||
{ | ||
#region singleVcardTwoContactShort | ||
private static readonly string singleMeCardContactShort = | ||
""" | ||
MECARD:N:Hood,Rick,,,;; | ||
""" | ||
; | ||
|
||
private static readonly string singleVcardContactShortFromMeCard = | ||
""" | ||
BEGIN:VCARD | ||
VERSION:3.0 | ||
FN:Rick Hood | ||
N:Hood;Rick;;;; | ||
END:VCARD | ||
""" | ||
; | ||
|
||
private static readonly string singleVcardTwoContactShort = | ||
""" | ||
BEGIN:VCARD | ||
|
@@ -41,6 +58,19 @@ public static class ContactData | |
""" | ||
; | ||
|
||
private static readonly Card singleVcardContactShortFromMeCardInstance = new | ||
( | ||
null, | ||
"3.0" | ||
) | ||
{ | ||
ContactNames = new NameInfo[] | ||
{ | ||
new NameInfo(0, Array.Empty<string>(), "Rick", "Hood", Array.Empty<string>(), Array.Empty<string>(), Array.Empty<string>()) | ||
}, | ||
ContactFullName = "Rick Hood" | ||
}; | ||
|
||
private static readonly Card singleVcardTwoContactShortInstance = new | ||
( | ||
null, | ||
|
@@ -106,6 +136,53 @@ public static class ContactData | |
#endregion | ||
|
||
#region singleVcardTwoContact | ||
private static readonly string singleMeCardContact = | ||
""" | ||
MECARD:N:Sanders,John,,,;TEL:495-522-3560;EMAIL:[email protected];ADR:,,Los Angeles,,,,USA;NOTE:Note test for VisualCard;; | ||
""" | ||
; | ||
|
||
private static readonly string singleVcardContactFromMeCard = | ||
""" | ||
BEGIN:VCARD | ||
VERSION:3.0 | ||
FN:John Sanders | ||
N:Sanders;John;;;; | ||
TEL;TYPE=CELL:495-522-3560 | ||
ADR;TYPE=HOME:;;Los Angeles;;;;USA | ||
EMAIL;TYPE=HOME:[email protected] | ||
NOTE:Note test for VisualCard | ||
END:VCARD | ||
""" | ||
; | ||
|
||
private static readonly Card singleVcardContactInstanceFromMeCard = new | ||
( | ||
null, | ||
"3.0" | ||
) | ||
{ | ||
ContactNames = new NameInfo[] | ||
{ | ||
new NameInfo(0, Array.Empty<string>(), "John", "Sanders", Array.Empty<string>(), Array.Empty<string>(), Array.Empty<string>()) | ||
}, | ||
ContactFullName = "John Sanders", | ||
ContactTelephones = new TelephoneInfo[] | ||
{ | ||
new TelephoneInfo(0, Array.Empty<string>(), new string[] { "CELL" }, "495-522-3560") | ||
}, | ||
ContactAddresses = new AddressInfo[] | ||
{ | ||
new AddressInfo(0, Array.Empty<string>(), new string[] { "HOME" }, "", "", "Los Angeles", "", "", "", "USA") | ||
}, | ||
ContactNotes = "Note test for VisualCard", | ||
ContactMails = new EmailInfo[] | ||
{ | ||
new EmailInfo(0, Array.Empty<string>(), new string[] { "HOME" }, "[email protected]") | ||
} | ||
}; | ||
|
||
private static readonly string singleVcardTwoContact = | ||
""" | ||
BEGIN:VCARD | ||
|
@@ -892,6 +969,24 @@ public static class ContactData | |
multipleVcardFourContacts, | ||
}; | ||
|
||
/// <summary> | ||
/// Test MeCard contacts | ||
/// </summary> | ||
public static readonly string[] meCardContacts = | ||
{ | ||
singleMeCardContactShort, | ||
singleMeCardContact, | ||
}; | ||
|
||
/// <summary> | ||
/// Test MeCard contacts | ||
/// </summary> | ||
public static readonly (string, string)[] vCardFromMeCardContacts = | ||
{ | ||
(singleMeCardContactShort, singleVcardContactShortFromMeCard), | ||
(singleMeCardContact, singleVcardContactFromMeCard), | ||
}; | ||
|
||
/// <summary> | ||
/// All the remaining valid contacts | ||
/// </summary> | ||
|
@@ -926,6 +1021,8 @@ public static class ContactData | |
vcardThreeOldSampleInstanceOne, | ||
vcardThreeOldSampleInstanceTwo, | ||
vcardThreeOldSampleInstanceThree, | ||
singleVcardContactInstanceFromMeCard, | ||
singleVcardContactShortFromMeCardInstance, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters