IOS-1758 minor renaming and removing unneeded code IOS-1758
authorAlejandro Gelos <agp@pep.security>
Tue, 20 Aug 2019 15:37:15 +0200
branchIOS-1758
changeset 97282d762ad64237
parent 9727 36be231969e5
child 9739 2c75dee27dbe
IOS-1758 minor renaming and removing unneeded code
pEpForiOS/UI/Compose/ViewModel/ComposeViewModel+InitData.swift
pEpForiOSTests/Models/EmailListViewModelTest.swift
pEpForiOSTests/UI/Compose/ViewModel/ComposeViewModel+InitDataTest.swift
     1.1 --- a/pEpForiOS/UI/Compose/ViewModel/ComposeViewModel+InitData.swift	Tue Aug 20 15:03:37 2019 +0200
     1.2 +++ b/pEpForiOS/UI/Compose/ViewModel/ComposeViewModel+InitData.swift	Tue Aug 20 15:37:15 2019 +0200
     1.3 @@ -126,19 +126,19 @@
     1.4          }
     1.5  
     1.6          mutating private func setupInitialSubject() {
     1.7 -            guard let om = originalMessage else {
     1.8 +            guard let originalMessage = originalMessage else {
     1.9                  // We have no original message. That's OK for compose mode .normal.
    1.10                  return
    1.11              }
    1.12              switch composeMode {
    1.13              case .replyFrom,
    1.14                   .replyAll:
    1.15 -                subject = ReplyUtil.replySubject(message: om)
    1.16 +                subject = ReplyUtil.replySubject(message: originalMessage)
    1.17              case .forward:
    1.18 -                subject = ReplyUtil.forwardSubject(message: om)
    1.19 +                subject = ReplyUtil.forwardSubject(message: originalMessage)
    1.20              case .normal:
    1.21                  if isDraftsOrOutbox {
    1.22 -                    subject = om.shortMessage ?? " "
    1.23 +                    subject = originalMessage.shortMessage ?? " "
    1.24                  }
    1.25                  // .normal is intentionally ignored here for other folder types
    1.26              }
     2.1 --- a/pEpForiOSTests/Models/EmailListViewModelTest.swift	Tue Aug 20 15:03:37 2019 +0200
     2.2 +++ b/pEpForiOSTests/Models/EmailListViewModelTest.swift	Tue Aug 20 15:37:15 2019 +0200
     2.3 @@ -298,7 +298,7 @@
     2.4          emailListVM.startMonitoring()
     2.5          let indexOfTheOneAndOnlyMsg = 0
     2.6          let vm = emailListVM.viewModel(for: indexOfTheOneAndOnlyMsg)
     2.7 -        XCTAssertEqual(vm?.message(), msg)
     2.8 +        XCTAssertEqual(vm?.message, msg)
     2.9          XCTAssertEqual(vm?.subject, msg.shortMessage)
    2.10      }
    2.11  
    2.12 @@ -329,7 +329,7 @@
    2.13              XCTFail()
    2.14              return
    2.15          }
    2.16 -        XCTAssertEqual(firstMsgVM.message(), msg)
    2.17 +        XCTAssertEqual(firstMsgVM.message, msg)
    2.18  
    2.19          // Create a message that must not be shown
    2.20          TestUtil.createMessage(inFolder: trashFolder, from: inbox.account.user)
     3.1 --- a/pEpForiOSTests/UI/Compose/ViewModel/ComposeViewModel+InitDataTest.swift	Tue Aug 20 15:03:37 2019 +0200
     3.2 +++ b/pEpForiOSTests/UI/Compose/ViewModel/ComposeViewModel+InitDataTest.swift	Tue Aug 20 15:37:15 2019 +0200
     3.3 @@ -535,7 +535,7 @@
     3.4              XCTAssertEqual(testee.composeMode, exp)
     3.5          }
     3.6          if let exp = originalMessage {
     3.7 -            XCTAssertEqual(testee.cloneOriginalMessage, exp)
     3.8 +            XCTAssertEqual(testee.originalMessage, exp)
     3.9          }
    3.10          if let exp = isDraftsOrOutbox {
    3.11              XCTAssertEqual(testee.isDraftsOrOutbox, exp)