IOS-1542 Deduplicate code. IOS-1542
authorDirk Zimmermann <dz@pep.security>
Mon, 15 Apr 2019 16:17:33 +0200
branchIOS-1542
changeset 82406cb52a5bf9d8
parent 8239 9e8eb6f3e246
child 8241 5cae4f720403
IOS-1542 Deduplicate code.
pEpForiOSTests/TestUtils/TestDataBase.swift
     1.1 --- a/pEpForiOSTests/TestUtils/TestDataBase.swift	Mon Apr 15 16:17:33 2019 +0200
     1.2 +++ b/pEpForiOSTests/TestUtils/TestDataBase.swift	Mon Apr 15 16:17:33 2019 +0200
     1.3 @@ -146,7 +146,7 @@
     1.4              return ident
     1.5          }
     1.6  
     1.7 -        func basicConnectInfoIMAP() -> BasicConnectInfo {
     1.8 +        func basicConnectInfo(emailProtocol: EmailProtocol) -> BasicConnectInfo {
     1.9              return BasicConnectInfo(
    1.10                  accountEmailAddress: idAddress,
    1.11                  loginName: imapLoginName ?? idAddress,
    1.12 @@ -156,20 +156,15 @@
    1.13                  networkPort: imapServerPort,
    1.14                  connectionTransport: ConnectionTransport(transport: imapServerTransport),
    1.15                  authMethod: nil,
    1.16 -                emailProtocol: .imap)
    1.17 +                emailProtocol: emailProtocol)
    1.18 +        }
    1.19 +
    1.20 +        func basicConnectInfoIMAP() -> BasicConnectInfo {
    1.21 +            return basicConnectInfo(emailProtocol: .imap)
    1.22          }
    1.23  
    1.24          func basicConnectInfoSMTP() -> BasicConnectInfo {
    1.25 -            return BasicConnectInfo(
    1.26 -                accountEmailAddress: idAddress,
    1.27 -                loginName: imapLoginName ?? idAddress,
    1.28 -                loginPasswordKeyChainKey: nil,
    1.29 -                loginPassword: password,
    1.30 -                networkAddress: imapServerAddress,
    1.31 -                networkPort: imapServerPort,
    1.32 -                connectionTransport: ConnectionTransport(transport: imapServerTransport),
    1.33 -                authMethod: nil,
    1.34 -                emailProtocol: .smtp)
    1.35 +            return basicConnectInfo(emailProtocol: .smtp)
    1.36          }
    1.37      }
    1.38