Skip to content

Commit

Permalink
Finished with unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maximkhatskevich committed May 9, 2017
1 parent 003bb31 commit 13aacba
Show file tree
Hide file tree
Showing 3 changed files with 337 additions and 104 deletions.
4 changes: 2 additions & 2 deletions Src/View/Root/Model/M.Intersection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ extension M.Intersection
}

static
func toggle() -> Action
func toggle(with p: Params = Params.defaults) -> Action
{
return trigger { m, next in

Expand All @@ -230,7 +230,7 @@ extension M.Intersection
next{ stop() }

case is Ready:
next{ start() }
next{ start(with: p) }

default:
break
Expand Down
30 changes: 11 additions & 19 deletions Tst/Tst.M.Core.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import XCTest
@testable
import TrafficLights

@testable
import XCEUniFlow

import XCETesting

//===
Expand Down Expand Up @@ -47,30 +49,20 @@ class Tst_M_Core: XCTestCase

func testSetup()
{
let expect = expectation(description: "Core.setup transition")
RXC.isNil("M.Core is NOT presented in GlobalModel yet") {

self.dispatcher.model ==> M.Core.self
}

//===

proxy
.submit{ M.Core.setup() }

proxy
.subscribeLater(self)
.onUpdate { m in

RXC.isNotNil("Core IS in Ready state") {

m ==> M.Core.Ready.self
}

//===

self.proxy.unsubscribe(self)
expect.fulfill()
}
self.dispatcher.process(M.Core.setup())

//===

waitForExpectations(timeout: 3.0)
RXC.isNotNil("M.Core IS presented in GlobalModel now") {

self.dispatcher.model ==> M.Core.self
}
}
}
Loading

0 comments on commit 13aacba

Please sign in to comment.