Skip to content

Commit

Permalink
Version 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Gematik-Entwicklung committed Sep 15, 2022
1 parent f471891 commit f266c3c
Show file tree
Hide file tree
Showing 35 changed files with 1,023 additions and 102 deletions.
3 changes: 2 additions & 1 deletion Brewfile
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
brew 'mint'
brew 'mint'
brew 'maven'
2 changes: 1 addition & 1 deletion Cartfile.private
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
github "Quick/Nimble" ~> 9.0
github "tadija/AEXML" "4.5.0"
github "tadija/AEXML" ~> 4.0
github "hectr/swift-stream-reader" "0.3.0"
github "swiftsocket/SwiftSocket" "2e6ba27140a29fae8a6331ba4463312e0c71a6b0"
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ github "SwiftCommon/DataKit" "1.1.0"
github "gematik/OpenSSL-Swift" "3.0.3"
github "hectr/swift-stream-reader" "0.3.0"
github "swiftsocket/SwiftSocket" "2e6ba27140a29fae8a6331ba4463312e0c71a6b0"
github "tadija/AEXML" "4.5.0"
github "tadija/AEXML" "4.6.1"
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -308,4 +308,4 @@ RUBY VERSION
ruby 2.6.5p114

BUNDLED WITH
2.3.16
2.3.20
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ open class CardSimulationTerminalTestCase: XCTestCase {
let manipulators = [cardImagePath, channelContextPath]
return CardSimulationTerminalResource(url: config,
configManipulators: manipulators,
simulatorVersion: "2.7.9-395")
simulatorVersion: "2.8.4-436")
}
#endif

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
//
// Copyright (c) 2022 gematik GmbH
//
// Licensed under the Apache License, Version 2.0 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an 'AS IS' BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import Foundation
import HealthCardAccess
@testable import HealthCardControl
import Nimble
import XCTest

final class HealthCardTypeExtChangeReferenceDataIntegrationTest: CardSimulationTerminalTestCase {
override class var configFileInput: String {
"Configuration/configuration_EGK_G2_1_80276883110000095711_GuD_TCP.xml"
}

override class var healthCardStatusInput: HealthCardStatus { .valid(cardType: .egk(generation: .g2_1)) }

func testChangeReferenceDataEgk21_success() throws {
let old = "123456" as Format2Pin
let new = "654321" as Format2Pin

expect(
try Self.healthCard.changeReferenceDataSetNewPin(
old: old,
new: new
)
.test()
) == ChangeReferenceDataResponse.success
}

func testChangeReferenceDataEgk21_wrongPasswordLength() throws {
let old = "123456" as Format2Pin
let new = "654321123456" as Format2Pin

expect(
try Self.healthCard.changeReferenceDataSetNewPin(
old: old,
new: new,
type: EgkFileSystem.Pin.mrpinHome,
dfSpecific: false
)
.test()
) == ChangeReferenceDataResponse.wrongPasswordLength
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
//
// Copyright (c) 2022 gematik GmbH
//
// Licensed under the Apache License, Version 2.0 (the License);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an 'AS IS' BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

import Foundation
import HealthCardAccess
@testable import HealthCardControl
import Nimble
import XCTest

// Note: This continuation of `HealthCardTypeExtChangeReferenceDataIntegrationTest` exists to separate
// the count dependent tests from the other ones.
final class HealthCardTypeExtChangeReferenceDataIntegrationTestCont: CardSimulationTerminalTestCase {
override class var configFileInput: String {
"Configuration/configuration_EGK_G2_1_80276883110000095711_GuD_TCP.xml"
}

override class var healthCardStatusInput: HealthCardStatus {
.valid(cardType: .egk(generation: .g2_1))
}

func testChangeReferenceDataEgk21_wrongSecretWarning() throws {
let wrongOld = "9999999" as Format2Pin
let correctOld = "123456" as Format2Pin
let new = "654321" as Format2Pin

expect(
try Self.healthCard.changeReferenceDataSetNewPin(
old: wrongOld,
new: new,
type: EgkFileSystem.Pin.mrpinHome,
dfSpecific: false
)
.test()
) == ChangeReferenceDataResponse.wrongSecretWarning(retryCount: 2)

expect(
try Self.healthCard.changeReferenceDataSetNewPin(
old: wrongOld,
new: new,
type: EgkFileSystem.Pin.mrpinHome,
dfSpecific: false
)
.test()
) == ChangeReferenceDataResponse.wrongSecretWarning(retryCount: 1)

expect(
try Self.healthCard.changeReferenceDataSetNewPin(
old: correctOld,
new: new,
type: EgkFileSystem.Pin.mrpinHome,
dfSpecific: false
)
.test()
) == ChangeReferenceDataResponse.success
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ final class HealthCardTypeExtVerifyPinTest: CardSimulationTerminalTestCase {
} == VerifyPinResponse.success
}

func testVerifyMrPinHomeEgk21Failing() {
func testVerifyMrPinHomeEgk21_WarningRetryCounter() {
let pinCode = "654321"
expect {
let format2Pin = try Format2Pin(pincode: pinCode)
return try Self.healthCard.verify(pin: format2Pin, type: EgkFileSystem.Pin.mrpinHome)
.test()
} == VerifyPinResponse.failed(retryCount: 2)
} == VerifyPinResponse.wrongSecretWarning(retryCount: 2)
}

static let allTests = [
("testVerifyMrPinHomeEgk21", testVerifyMrPinHomeEgk21),
("testVerifyMrPinHomeEgk21Failing", testVerifyMrPinHomeEgk21Failing),
("testVerifyMrPinHomeEgk21Failing", testVerifyMrPinHomeEgk21_WarningRetryCounter),
]
}
Loading

0 comments on commit f266c3c

Please sign in to comment.