Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
add unique map test
Browse files Browse the repository at this point in the history
  • Loading branch information
Russell Stephens committed Sep 4, 2018
1 parent ea1fa1e commit 5090069
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions SnailTests/VariableTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,19 @@ class VariableTests: XCTestCase {
XCTAssertEqual(subject.value.count, subjectCharactersCount)
}

func testUniqueFireCounts() {
let subject = Unique("one")
var firedCount = 0

subject.map { $0.count }.asObservable().subscribe(onNext: { _ in
firedCount += 1
})

subject.value = "two"

XCTAssertTrue(firedCount == 1)
}

func testMapToVoid() {
let subject = Variable("initial")
var fired = false
Expand Down

0 comments on commit 5090069

Please sign in to comment.