Skip to content

Instantly share code, notes, and snippets.

@brunomunizaf
Created November 20, 2020 04:52
Show Gist options
  • Save brunomunizaf/26668cefc7ff4b8a8c3b2faef3dfd9ef to your computer and use it in GitHub Desktop.
Save brunomunizaf/26668cefc7ff4b8a8c3b2faef3dfd9ef to your computer and use it in GitHub Desktop.
import XCTest
@testable import DataBindings
final class DataBindingsTests: XCTestCase {
var sut: ViewModel!
override func setUp() {
sut = ViewModel()
}
func test_Increment() {
var value: Int!
sut.countBox.bind { value = $0 }
sut.increment()
XCTAssertEqual(value, 1)
}
func test_Decrement() {
var value: Int!
sut.countBox.bind { value = $0 }
sut.decrement()
XCTAssertEqual(value, -1)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment