forked from WeTransfer/WeScan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAVCaptureVideoOrientationTests.swift
44 lines (33 loc) · 1.27 KB
/
AVCaptureVideoOrientationTests.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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
final 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)
}
}