forked from WeTransfer/WeScan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ec3ddd
commit 99149e1
Showing
22 changed files
with
1,312 additions
and
912 deletions.
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
[submodule "Submodules/WeTransfer-iOS-CI"] | ||
path = Submodules/WeTransfer-iOS-CI | ||
url=https://github.com/WeTransfer/WeTransfer-iOS-CI.git | ||
[submodule "Submodules/ios-snapshot-test-case"] | ||
path = Submodules/ios-snapshot-test-case | ||
url = https://github.com/uber/ios-snapshot-test-case/ | ||
branch = master |
Submodule ios-snapshot-test-case
added at
de1c71
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// AVCaptureVideoOrientationTests.swift | ||
// WeScanTests | ||
// | ||
// Created by James Campbell on 8/8/18. | ||
// Copyright © 2018 WeTransfer. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
import AVFoundation | ||
|
||
@testable import WeScan | ||
|
||
class AVCaptureVideoOrientationTests: XCTestCase { | ||
|
||
func testPortaitsMapToPortrait() { | ||
XCTAssertEqual(AVCaptureVideoOrientation(deviceOrientation: .portrait), .portrait) | ||
} | ||
|
||
func testPortaitsUpsideDownMapToPortraitUpsideDown() { | ||
XCTAssertEqual(AVCaptureVideoOrientation(deviceOrientation: .portraitUpsideDown), .portraitUpsideDown) | ||
} | ||
|
||
func testLandscapeLeftMapToLandscapeLeft() { | ||
XCTAssertEqual(AVCaptureVideoOrientation(deviceOrientation: .landscapeLeft), .landscapeLeft) | ||
} | ||
|
||
func testLandscapeRightMapToLandscapeRight() { | ||
XCTAssertEqual(AVCaptureVideoOrientation(deviceOrientation: .landscapeRight), .landscapeRight) | ||
} | ||
|
||
func testFaceUpMapToPortrait() { | ||
XCTAssertEqual(AVCaptureVideoOrientation(deviceOrientation: .faceUp), .portrait) | ||
} | ||
|
||
func testFaceDownMapToPortraitUpsideDown() { | ||
XCTAssertEqual(AVCaptureVideoOrientation(deviceOrientation: .faceDown), .portraitUpsideDown) | ||
} | ||
|
||
func testDefaultToPortrait() { | ||
XCTAssertEqual(AVCaptureVideoOrientation(deviceOrientation: .unknown), .portrait) | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// | ||
// CGAffineTransformTests.swift | ||
// WeScanTests | ||
// | ||
// Created by James Campbell on 8/8/18. | ||
// Copyright © 2018 WeTransfer. All rights reserved. | ||
// | ||
|
||
import XCTest | ||
@testable import WeScan | ||
|
||
class CGAffineTransformTests: XCTestCase { | ||
|
||
func testScalesUpCorrectly() { | ||
|
||
let fromSize = CGSize(width: 1, height: 1) | ||
let toSize = CGSize(width: 2, height: 2) | ||
|
||
let scale = CGAffineTransform.scaleTransform(forSize: fromSize, aspectFillInSize: toSize) | ||
|
||
XCTAssertEqual(scale.a, 2) | ||
XCTAssertEqual(scale.d, 2) | ||
} | ||
|
||
func testScalesDownCorrectly() { | ||
|
||
let fromSize = CGSize(width: 2, height: 2) | ||
let toSize = CGSize(width: 1, height: 1) | ||
|
||
let scale = CGAffineTransform.scaleTransform(forSize: fromSize, aspectFillInSize: toSize) | ||
|
||
XCTAssertEqual(scale.a, 0.5) | ||
XCTAssertEqual(scale.d, 0.5) | ||
} | ||
|
||
func testTranslatesCorrectly() { | ||
|
||
let fromRect = CGRect(x: 0, y: 0, width: 10, height: 10) | ||
let toRect = CGRect(x: 5, y: 5, width: 10, height: 10) | ||
|
||
let translate = CGAffineTransform.translateTransform(fromCenterOfRect: fromRect, toCenterOfRect: toRect) | ||
|
||
XCTAssertEqual(translate.a, 1.0) | ||
XCTAssertEqual(translate.d, 1.0) | ||
XCTAssertEqual(translate.tx, 5.0) | ||
XCTAssertEqual(translate.ty, 5.0) | ||
} | ||
|
||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.