Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • enzevalos/enzevalos_iphone
1 result
Show changes
Commits on Source (14)
Showing with 387 additions and 11 deletions
......@@ -152,6 +152,8 @@
47F867E22052B48E00AA832F /* libz.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 47F867E12052B48E00AA832F /* libz.tbd */; };
47F867E42052B49800AA832F /* libbz2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 47F867E32052B49800AA832F /* libbz2.tbd */; };
50F2E7D66366C779705987A7 /* Pods_enzevalos_iphoneUITests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AF67EF30BB065CC9C0D17940 /* Pods_enzevalos_iphoneUITests.framework */; };
71497EC0240FE37800B6210F /* MailComparison.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71497EBF240FE37800B6210F /* MailComparison.swift */; };
71497EC3240FF82700B6210F /* MailComparisonTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71497EC2240FF82700B6210F /* MailComparisonTests.swift */; };
71DFE5BA240679E80042019C /* HeaderExtractionValues.swift in Sources */ = {isa = PBXBuildFile; fileRef = 71DFE5B9240679E80042019C /* HeaderExtractionValues.swift */; };
7500EE9D4F3130671F5C1AE2 /* Pods_enzevalos_iphoneTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7977EA7012D8E98D186D5C60 /* Pods_enzevalos_iphoneTests.framework */; };
8428A8531F4369C0007649A5 /* Gamification.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8428A8521F4369C0007649A5 /* Gamification.storyboard */; };
......@@ -549,6 +551,8 @@
48C250BB32BF11B683003BA1 /* Pods-enzevalos_iphone-enzevalos_iphoneUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-enzevalos_iphone-enzevalos_iphoneUITests.debug.xcconfig"; path = "../enzevalos_iphone_workspace/Pods/Target Support Files/Pods-enzevalos_iphone-enzevalos_iphoneUITests/Pods-enzevalos_iphone-enzevalos_iphoneUITests.debug.xcconfig"; sourceTree = "<group>"; };
66E758F271CD65AB3E5FE7A7 /* Pods-enzevalos_iphoneUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-enzevalos_iphoneUITests.debug.xcconfig"; path = "../enzevalos_iphone_workspace/Pods/Target Support Files/Pods-enzevalos_iphoneUITests/Pods-enzevalos_iphoneUITests.debug.xcconfig"; sourceTree = "<group>"; };
6EBCCD02AD3B95D8317810E2 /* Pods-enzevalos_iphoneTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-enzevalos_iphoneTests.debug.xcconfig"; path = "../enzevalos_iphone_workspace/Pods/Target Support Files/Pods-enzevalos_iphoneTests/Pods-enzevalos_iphoneTests.debug.xcconfig"; sourceTree = "<group>"; };
71497EBF240FE37800B6210F /* MailComparison.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MailComparison.swift; sourceTree = "<group>"; };
71497EC2240FF82700B6210F /* MailComparisonTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MailComparisonTests.swift; sourceTree = "<group>"; };
71DFE5B9240679E80042019C /* HeaderExtractionValues.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderExtractionValues.swift; sourceTree = "<group>"; };
796D16D79BED5D60B580E602 /* Pods-enzevalos_iphoneUITests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-enzevalos_iphoneUITests.release.xcconfig"; path = "../enzevalos_iphone_workspace/Pods/Target Support Files/Pods-enzevalos_iphoneUITests/Pods-enzevalos_iphoneUITests.release.xcconfig"; sourceTree = "<group>"; };
7977EA7012D8E98D186D5C60 /* Pods_enzevalos_iphoneTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_enzevalos_iphoneTests.framework; sourceTree = BUILT_PRODUCTS_DIR; };
......@@ -576,7 +580,7 @@
97AACD2324178C230078A68E /* AuthenticationModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationModel.swift; sourceTree = "<group>"; };
97C5279E241A9F7B0030BBC9 /* AuthenticationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationTests.swift; sourceTree = "<group>"; };
97C527A0241AA4090030BBC9 /* GeneratedMocks.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = GeneratedMocks.swift; path = enzevalos_iphoneTests/GeneratedMocks.swift; sourceTree = SOURCE_ROOT; };
988C9C5C240D507A006213F0 /* PhishingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhishingTests.swift; sourceTree = "<group>"; };
988C9C5C240D507A006213F0 /* PhishingTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PhishingTests.swift; path = ../PhishingTests.swift; sourceTree = "<group>"; };
9A132EDE8BCA06ACDB505C22 /* Pods-enzevalos_iphoneUITests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-enzevalos_iphoneUITests.debug.xcconfig"; path = "../enzevalos_iphone_workspace/Pods/Target Support Files/Pods-enzevalos_iphoneUITests/Pods-enzevalos_iphoneUITests.debug.xcconfig"; sourceTree = "<group>"; };
9B3D62838C729BAC6832270A /* Pods-enzevalos_iphone-AdHoc.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-enzevalos_iphone-AdHoc.debug.xcconfig"; path = "../enzevalos_iphone_workspace/Pods/Target Support Files/Pods-enzevalos_iphone-AdHoc/Pods-enzevalos_iphone-AdHoc.debug.xcconfig"; sourceTree = "<group>"; };
A102AA891EDDB4E80024B457 /* videoOnboarding2.m4v */ = {isa = PBXFileReference; lastKnownFileType = file; path = videoOnboarding2.m4v; sourceTree = "<group>"; };
......@@ -1153,6 +1157,23 @@
path = private;
sourceTree = "<group>";
};
71497EBE240FE2E300B6210F /* phishing */ = {
isa = PBXGroup;
children = (
71497EBF240FE37800B6210F /* MailComparison.swift */,
);
path = phishing;
sourceTree = "<group>";
};
71497EC1240FF7FC00B6210F /* phishing */ = {
isa = PBXGroup;
children = (
988C9C5C240D507A006213F0 /* PhishingTests.swift */,
71497EC2240FF82700B6210F /* MailComparisonTests.swift */,
);
path = phishing;
sourceTree = "<group>";
};
78280F99990BFF65543B7F0B /* Frameworks */ = {
isa = PBXGroup;
children = (
......@@ -1297,6 +1318,7 @@
A13526771D955BDF00D3BFE1 /* enzevalos_iphone */ = {
isa = PBXGroup;
children = (
71497EBE240FE2E300B6210F /* phishing */,
47EABF05241A9C7000774A93 /* Authentication */,
476406872416B54D00C7D426 /* SwiftUI */,
476403FA2413F95300C7D426 /* OpenSSL */,
......@@ -1340,8 +1362,8 @@
A135268F1D955BE000D3BFE1 /* enzevalos_iphoneTests */ = {
isa = PBXGroup;
children = (
71497EC1240FF7FC00B6210F /* phishing */,
97C5279D241A9F690030BBC9 /* authentication */,
988C9C5C240D507A006213F0 /* PhishingTests.swift */,
47F0376C22A7278A0005C9DE /* private */,
470709202189C24800DF71A3 /* testKeys */,
470709112189BB4A00DF71A3 /* testMails */,
......@@ -2032,6 +2054,7 @@
4707096D1F8F9F4900657F41 /* ExportViewController.swift in Sources */,
F12060801DA540FE00F6EF37 /* RefreshControlExtension.swift in Sources */,
4751C6FC2344C8D1006B2A4D /* KeyTableViewController.swift in Sources */,
71497EC0240FE37800B6210F /* MailComparison.swift in Sources */,
A13526811D955BDF00D3BFE1 /* enzevalos_iphone.xcdatamodeld in Sources */,
472F39821E1E5347009260FB /* Mail_Address+CoreDataProperties.swift in Sources */,
477548E221F77466000B22A8 /* SecurityIndicator.swift in Sources */,
......@@ -2116,6 +2139,7 @@
8428A8831F436AC9007649A5 /* GamificationDataUnitTest.swift in Sources */,
3EC35F302003838E008BDF95 /* InvitationTests.swift in Sources */,
474054982244D7A9007CF83B /* MailServerConfigurationTest.swift in Sources */,
71497EC3240FF82700B6210F /* MailComparisonTests.swift in Sources */,
479B5977206914BE00B3944D /* CryptoTests.swift in Sources */,
A15D215F223BE6E4003E0CE0 /* MailTest.swift in Sources */,
47EABF0F2420C63600774A93 /* AuthenticationTests.swift in Sources */,
......
......@@ -301,7 +301,7 @@ class DataHandler {
self.deleteNum("PersistentMail", type: "uid", search: uid)
}
private func removeAll(entity: String) {
func removeAll(entity: String) {
let DelAllReqVar = NSBatchDeleteRequest(fetchRequest: NSFetchRequest<NSFetchRequestResult>(entityName: entity))
do {
try managedObjectContext.execute(DelAllReqVar)
......
......@@ -21,7 +21,7 @@
import Foundation
open class EphemeralMail: Mail {
public var from: NSSet?
public var cc: NSSet?
public var bcc: NSSet?
public var to: NSSet
......@@ -31,7 +31,8 @@ open class EphemeralMail: Mail {
public var uid: UInt64
public var predecessor: PersistentMail?
public init(to: NSSet = [], cc: NSSet = [], bcc: NSSet = [], date: Date = Date(), subject: String? = nil, body: String? = ""/*UserManager.loadUserSignature()*/, uid: UInt64 = 0, predecessor: PersistentMail? = nil) {
public init(from: NSSet = [], to: NSSet = [], cc: NSSet = [], bcc: NSSet = [], date: Date = Date(), subject: String? = nil, body: String? = ""/*UserManager.loadUserSignature()*/, uid: UInt64 = 0, predecessor: PersistentMail? = nil) {
self.from = from
self.cc = cc
self.bcc = bcc
self.to = to
......
......@@ -22,7 +22,7 @@ import Foundation
public protocol Mail: Comparable {
//var from: NSSet? {get}
var cc: NSSet? { get }
var bcc: NSSet? { get }
var to: NSSet { get }
......
......@@ -33,6 +33,8 @@ A PersistentMail stores all information about one mail:
*/
@objc(PersistentMail)
open class PersistentMail: NSManagedObject, Mail {
//public var from: NSSet?
public var predecessor: PersistentMail? = nil
var showMessage: Bool = false
......@@ -180,6 +182,7 @@ open class PersistentMail: NSManagedObject, Mail {
var decryptedWithOldPrivateKey: Bool = false
func getReceivers() -> [Mail_Address] {
var receivers = [Mail_Address] ()
for obj in to {
......@@ -203,6 +206,7 @@ open class PersistentMail: NSManagedObject, Mail {
}
return receivers
}
func getSubjectWithFlagsString() -> String {
let subj: String
......
......@@ -221,7 +221,7 @@ extension PersistentMail {
return 0
}
}
/**
/*
Please read the RFC!
*/
public var uidvalidity: UInt32? {
......@@ -258,6 +258,7 @@ extension PersistentMail {
return Mail_Address()
}
}
public var containsSecretKey: Bool {
get {
return secretKey != nil
......
......@@ -152,7 +152,6 @@ extension String {
foundLinks.append(String(self[range]))
}
return (foundLinks)
}
func htmlTagLinkName() -> [String]{
......
//
// MailComparison.swift
// enzevalos_iphone
//
// Created by Katharina Müller and Viktoria Sorgalla on 04.03.20.
// Copyright © 2020 fu-berlin. All rights reserved.
//
import Foundation
import CoreData
class MailComparison{
// private func compareMailToContacts() -> Any{
// let dataHandler = DataHandler.handler
// let contacts = dataHandler.getContacts()
// let addresses = dataHandler.getAddresses()
// for adr in addresses{
// let address:String = adr as! String
// if EnzevalosContact.isAddress(address){
// return("isContact")
// }
// return("noContact")
// }
// //var first = String(contacts[0].from)
// //var first_address = String(addresses[0])
// // let isEqual = (first == first_address)
//
// //let records = DataHandler.handler.getContactByAddress(email).records
// }
// public var addresses: [MailAddress]{
// get{
// if let addrs = contact.addresses as? Set<Mail_Address> {
// return Array(addrs)
// }
// return []
// }
// }
// @NSManaged public var contact: EnzevalosContact
//
// public func compareSender(_ mail: PersistentMail) -> Any {
// let senderAddress = mail.from.mailAddress
// var senderContact = mail.from.contact
//
// if (senderContact == contact){
// print("joke")
// }
//
// for addr in addresses {
// if senderAddress == addr.mailAddress {
// return true
// }
// return false
// }
// return "empty"
// }
//var contact_name = contact.name
// private func test () -> Any {
// var list = ["Anna Mustermann", "Max Normal", "kllk jlkm", "jnkjnjk lknl", "Max Normal"]
// var searchValue = "Max Normal"
//
//
// var currentIndex = 0
// for name in list{
// if name == searchValue{
// print("Found \(name) for index \(currentIndex)")
// }
// currentIndex += 1
// }
// }
}
// MARK: - Mocks generated from file: enzevalos_iphone/AuthenticationModel.swift at 2020-03-18 10:30:41 +0000
// MARK: - Mocks generated from file: enzevalos_iphone/AuthenticationModel.swift at 2020-03-30 07:41:15 +0000
//
// AuthenticationModel.swift
......@@ -653,7 +653,7 @@ import Foundation
}
// MARK: - Mocks generated from file: enzevalos_iphone/AuthenticationViewModel.swift at 2020-03-18 10:30:41 +0000
// MARK: - Mocks generated from file: enzevalos_iphone/AuthenticationViewModel.swift at 2020-03-30 07:41:15 +0000
//
// AuthenticationViewModel.swift
......
......@@ -102,7 +102,6 @@ class MailTest: XCTestCase {
}
}
func testFormatMail() {
// Init
let tos = ["to1@example.com", "to2@example.com"]
......
//
import XCTest
import Contacts
//import Contacts
@testable import enzevalos_iphone
class MailComparisonTests: XCTestCase {
let datahandler = DataHandler.handler
let userAdr = "alice@example.com"
let userName = "alice"
var user: MCOAddress = MCOAddress.init(displayName: "alice", mailbox: "alice@example.com")
let userAdr_1 = "bob@enzevalos.de"
let userName_1 = "bob"
var user_1: MCOAddress = MCOAddress.init(displayName: "bob", mailbox: "bob@enzevalos.de")
let userAdr_2 = "carl@test.com"
let userName_2 = "carl"
var user_2: MCOAddress = MCOAddress.init(displayName: "Carl", mailbox: "carl@test.com")
override func setUp() {
super.setUp()
datahandler.reset()
XCTAssertEqual(datahandler.getContacts().count, 0)
XCTAssertEqual(datahandler.getAddresses().count, 0)
}
override func tearDown() {
datahandler.reset()
super.tearDown()
}
func testMail(from: MCOAddress, to: [MCOAddress], cc: [MCOAddress], bcc: [MCOAddress], flags: MCOMessageFlag = MCOMessageFlag.init(rawValue: 0), folder: String = "INBOX", date: Date = Date(timeIntervalSince1970: TimeInterval(arc4random())), cryptoObject: CryptoObject? = nil, body: String = String.random(length: 20)) -> PersistentMail? {
let subject = String.random(length: 20)
let id = UInt64(arc4random())
var body = body
if let decryptedBody = cryptoObject?.decryptedText {
body = decryptedBody
}
var mail: PersistentMail?
mail = datahandler.createMail(id, sender: from, receivers: to, cc: cc, time: date, received: true, subject: subject, body: body, flags: flags, record: nil, autocrypt: nil, decryptedData: cryptoObject, folderPath: folder, secretKey: nil, encryptedBody: cryptoObject?.chiperString)
return mail
}
/**************
Code
******************/
@NSManaged public var eContact: EnzevalosContact
func countMatches(_ mailAddr: String, _ inboxMails: [PersistentMail]) -> Int {
var senders: [String] = []
for sender in inboxMails{
let sender: String = sender.from.mailAddress
senders.append(sender)
}
var numberOfFoundMatches = 0
for addr in senders{
if addr == mailAddr{
numberOfFoundMatches += 1
if numberOfFoundMatches == 2{
return numberOfFoundMatches
}
}
}
return numberOfFoundMatches
}
public func compareSenderToContacts(_ mail: PersistentMail? ) -> String {
let senderAddress = mail?.from.mailAddress
// Case 1: Is the address of the sender in the address book?
let enzContacts = datahandler.getContacts()
for contact in enzContacts {
let contMailAddr = contact.cnContact?.getMailAddresses()
if contMailAddr != nil{
for mAddr in contMailAddr!{
if mAddr.mailAddress == senderAddress {
return "is a contact"
}
}
}
}
// Case 2: Is the address of the sender known through previous mails?
let inboxMails = datahandler.getAllPersistentMails()
if countMatches(senderAddress!, inboxMails) > 1{
return "has alrady send an email"
}
// Case 3: The identity of an mail address is known, but not the (sub-)domain
return "not known"
}
/**************
End Code
****************/
@NSManaged public var addresses: NSSet
private func createAddressBook(_ senders: [MCOAddress]) {
for sender in senders {
let con = CNMutableContact()
let value = sender.mailbox! as AnyObject
let name = sender.displayName
let nameArray = name!.split(separator: " ").map(String.init)
con.givenName = nameArray.first!
con.emailAddresses.append(CNLabeledValue(label: CNLabelOther, value: value as! NSString))
// Saving the newly created contact
let store = CNContactStore()
let saveRequest = CNSaveRequest()
saveRequest.add(con, toContainerWithIdentifier:nil)
try! store.execute(saveRequest)
}
}
private func resetAddressBook(_ senders: [MCOAddress]) {
for sender in senders {
do {
let name = sender.displayName!
let predicate = CNContact.predicateForContacts(matchingName: name)
let store = CNContactStore()
let contacts = try store.unifiedContacts(matching: predicate,keysToFetch: [CNContactGivenNameKey as CNKeyDescriptor, CNContactFamilyNameKey as CNKeyDescriptor, CNContactImageDataKey as CNKeyDescriptor])
guard contacts.count > 0, let selectedContact = contacts.first else { throw Error.self as! Error }
let request = CNSaveRequest()
let mutableContact = selectedContact.mutableCopy() as! CNMutableContact
request.delete(mutableContact)
try store.execute(request)
} catch { }
}
}
func testCompareSenderToContacts () {
let mail_1 = testMail(from: user, to: [], cc: [], bcc: [])
let mail_2 = testMail(from: user_1, to: [], cc: [], bcc: [])
let mail_3 = testMail(from: user_2, to: [], cc: [], bcc: [])
let mail_4 = testMail(from: user_2, to: [], cc: [], bcc: [])
let mailsInInbox: [PersistentMail] = [mail_1!, mail_2!, mail_3!, mail_4!]
createAddressBook([user])
XCTAssertEqual("is a contact", compareSenderToContacts(mailsInInbox[0]))
XCTAssertEqual("not known", compareSenderToContacts(mailsInInbox[1]))
XCTAssertEqual("has alrady send an email", compareSenderToContacts(mailsInInbox[2]))
// The created user has to be deleted after the test
resetAddressBook([user])
}
}
//
// PhishingTests.swift
// enzevalos_iphoneTests
//
// Created by Viktoria Sorgalla on 02.03.20.
// Copyright © 2020 fu-berlin. All rights reserved.
//
import XCTest
@testable import enzevalos_iphone
class PhishingTests: XCTestCase {
// setup for mail address splitting
var testEMail = "alice.bob@moep.blubb.de"
var finalTestEMailSplitAddress = ["alice.bob", "moep", "blubb", "de"]
var finalTestEMailIdentity = "alice.bob"
var finalTestEMailSubDomains = ["moep", "blubb"]
var finalTestEMailDomain = "de"
var TestText = "blabla moep jkjlkj lkjkljknmbjks llhil k. jhkhkih. huhuhj! fsdf bob.alice@zedat.fu-berlin.de dfsf. jhjknjknjkh https://git.imp.fu-berlin.de/enzevalos/enzevalos_iphone/issues/240 hjkhjkhkhn www.google.de kljhl@hjkghgkhj.com nljbjkjk.de url tag html mail <a href='https://www.w3schools.com'>Visit W3Schools</a> hjhkhiuhziu kjhkl <a href=\"https://www.w2schools.com\">Visit W2Schools</a>. lknljnlk. kmm /n lmölmpöl < a href=\"https://www.w8schools.com\">Visit W8Schools</a> gfg fghfghnhg <a href=\"https://www.w33schools.com\">Visit W33Schools</a> nkjhjkhkjn,mn jnmnklmj j <a href=\"https://www.w22schools.com\">Visit W22Schools</ a> hghjcfgh hfgchnvhj vgjcgj cjghcj <a href=\"https://www.w99schools.com\">Visit W99Schools</a >"
// setup for find mail address in text
var finalMailAddresses = ["bob.alice@zedat.fu-berlin.de", "kljhl@hjkghgkhj.com"]
// setup for find URLs in text
var finalURLs = ["https://git.imp.fu-berlin.de/enzevalos/enzevalos_iphone/issues/240", "http://www.google.de", "http://nljbjkjk.de", "https://www.w3schools.com", "https://www.w2schools.com", "https://www.w8schools.com", "https://www.w33schools.com", "https://www.w22schools.com", "https://www.w99schools.com"]
// setup for tag tests
var finalTestTextFindHtmlTags = ["<a href=\'https://www.w3schools.com\'>Visit W3Schools</a>", "<a href=\"https://www.w2schools.com\">Visit W2Schools</a>", "< a href=\"https://www.w8schools.com\">Visit W8Schools</a>", "<a href=\"https://www.w33schools.com\">Visit W33Schools</a>", "<a href=\"https://www.w22schools.com\">Visit W22Schools</ a>", "<a href=\"https://www.w99schools.com\">Visit W99Schools</a >"]
var finalTestTextHtmlTagURL = ["https://www.w3schools.com", "https://www.w2schools.com", "https://www.w8schools.com", "https://www.w33schools.com", "https://www.w22schools.com", "https://www.w99schools.com"]
var finalTestTexthttpTagLinkName = ["Visit W3Schools", "Visit W2Schools", "Visit W8Schools", "Visit W33Schools", "Visit W22Schools", "Visit W99Schools"]
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
super.tearDown()
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testSplitMailAddress(){
let arr = testEMail.splitAddress()
XCTAssertNotNil(arr)
XCTAssertEqual(arr[0], finalTestEMailSplitAddress[0])
XCTAssertEqual(arr[1], finalTestEMailSplitAddress[1])
XCTAssertEqual(arr[2], finalTestEMailSplitAddress[2])
XCTAssertEqual(arr[3], finalTestEMailSplitAddress[3])
}
func testGetMailIdentity(){
XCTAssertEqual(testEMail.getLocalMailIdentity(), finalTestEMailIdentity)
}
func testGetSubdomains(){
let arr = testEMail.getSubdomains()
XCTAssertNotNil(arr)
XCTAssertEqual(arr[0], finalTestEMailSubDomains[0])
XCTAssertEqual(arr[1], finalTestEMailSubDomains[1])
}
func testGetDomain(){
XCTAssertEqual(testEMail.getDomain(), finalTestEMailDomain)
}
func testTextFindMailAddress(){
let arr = TestText.findMailAddress()
XCTAssertNotNil(arr)
XCTAssertEqual(arr[0], finalMailAddresses[0])
XCTAssertEqual(arr[1], finalMailAddresses[1])
}
func testTextFindURL(){
let arr = TestText.findURL()
XCTAssertNotNil(arr)
XCTAssertEqual(arr[0], finalURLs[0])
XCTAssertEqual(arr[1], finalURLs[1])
XCTAssertEqual(arr[2], finalURLs[2])
XCTAssertEqual(arr[3], finalURLs[3])
}
func testTextFindHlmlTags(){
let arr = TestText.findHtmlTags()
XCTAssertNotNil(arr)
XCTAssertEqual(arr[0], finalTestTextFindHtmlTags[0])
XCTAssertEqual(arr[1], finalTestTextFindHtmlTags[1])
XCTAssertEqual(arr[2], finalTestTextFindHtmlTags[2])
XCTAssertEqual(arr[3], finalTestTextFindHtmlTags[3])
XCTAssertEqual(arr[4], finalTestTextFindHtmlTags[4])
XCTAssertEqual(arr[5], finalTestTextFindHtmlTags[5])
}
func testTextHtmlTagURL(){
let arr = TestText.htmlTagURL()
XCTAssertNotNil(arr)
XCTAssertEqual(arr[0], finalTestTextHtmlTagURL[0])
XCTAssertEqual(arr[1], finalTestTextHtmlTagURL[1])
XCTAssertEqual(arr[2], finalTestTextHtmlTagURL[2])
XCTAssertEqual(arr[3], finalTestTextHtmlTagURL[3])
XCTAssertEqual(arr[4], finalTestTextHtmlTagURL[4])
XCTAssertEqual(arr[5], finalTestTextHtmlTagURL[5])
}
func testTextHttpTagLinkName(){
let arr = TestText.htmlTagLinkName()
XCTAssertNotNil(arr)
XCTAssertEqual(arr[0], finalTestTexthttpTagLinkName[0])
XCTAssertEqual(arr[1], finalTestTexthttpTagLinkName[1])
XCTAssertEqual(arr[2], finalTestTexthttpTagLinkName[2])
XCTAssertEqual(arr[3], finalTestTexthttpTagLinkName[3])
XCTAssertEqual(arr[4], finalTestTexthttpTagLinkName[4])
XCTAssertEqual(arr[5], finalTestTexthttpTagLinkName[5])
}
}