Created
January 22, 2018 23:24
-
-
Save adkron/783d084e5d92432cc2597c8ae01d364b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule StructureOn.DCE.Connection.Watcher.Test do | |
use ExUnit.Case, async: true | |
use ExUnitProperties | |
alias StructureOn.DCE.Connection.Watcher, as: Subject | |
alias StructureOn.DCE.Connection.Supervisor | |
property "new addresses create new Connections" do | |
check all addresses <- unique_list_of(String.printable()), | |
max_runs: 50 do | |
for address <- addresses do | |
%{active: before_children} = Supervisor.which_children Supervisor | |
EventDispatcher.dispatch :e_struxure_on_server_added, address | |
%{active: after_children} = Supervisor.which_children Supervisor | |
assert after_children == before_children + 1 | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment