Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

Commit

Permalink
Added unit test
Browse files Browse the repository at this point in the history
Summary: Test getting interactions from properties such as opacity, scale, and etc.

Reviewers: O2 Material Motion, O4 Material Apple platform reviewers, #material_motion, featherless

Reviewed By: O2 Material Motion, O4 Material Apple platform reviewers, #material_motion, featherless

Tags: #material_motion

Differential Revision: http://codereview.cc/D3152
  • Loading branch information
randcode-generator committed May 3, 2017
1 parent 7fe07b0 commit cb8ba4f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/unit/MotionRuntimeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,23 @@ class MotionRuntimeTests: XCTestCase {
XCTAssertEqual(results.count, 1)
}

func testReturnsInteractionsOfProperties() {
let runtime = MotionRuntime(containerView: UIView())

let view = UIView()
let tweenA = Tween<CGFloat>(duration: 1, values: [1, 0, 1])
runtime.add(tweenA, to: runtime.get(view.layer).opacity)

let tweenB = Tween<CGFloat>(duration: 1, values: [1.3])
runtime.add(tweenB, to: runtime.get(view.layer).scale)

var results = runtime.interactions(ofType: Tween.self, for: runtime.get(view.layer).opacity)
XCTAssertEqual(results.count, 1)

results = runtime.interactions(ofType: Tween.self, for: runtime.get(view.layer).scale)
XCTAssertEqual(results.count, 1)
}

func testRuntimeStart() {
let promise = expectation(description: "start interaction B when interaction A is at state")

Expand Down

0 comments on commit cb8ba4f

Please sign in to comment.