Testing Signal bindings
See original GitHub issueThis is a question which originates from #551.
Is it also possible to use BindSignal
instead of Subscribe
?
I would like to write a unit test that checks my bindings.
Here is what I would like to do:
[Test]
public void Signal_SomeSignal_ShouldFireAllRelated()
{
SignalBusInstaller.Install(Container);
ProjectSignals.BindSignals(Container); // Binds all my signals for my project
var someMock = new Mock<ISomeInterface>();
Container.Bind<ISomeInterface>().FromInstance(someMock.Object);
var target = Container.Resolve<SignalBus>();
target.Fire<Signal_SomeSignal>();
someMock .Verify(x => x.DoSomething(), Times.Exactly(1));
}
But this doesn’t work. No Subscriptions.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
How to measure and evaluate binding affinities
A simple way to test whether binding occurs when there is no binding signal is to carry out a competition experiment.
Read more >Ligand binding assay
Ligand binding assays provide a measure of the interactions that occur between two molecules, such as protein-bindings, as well as the degree of...
Read more >Binding Check - Definition and Relevance | Nanopedia
For a Binding Check assay, the TRIC signal of Target and Complex are compared to yield a qualitative yes/no answer to whether there...
Read more >Analyzing Kinetic Binding Data - Assay Guidance Manual
Experimentally the rates are determined by measuring the time course of test compound binding to the target, directly or indirectly.
Read more >Yes-No Binding
The first step in using Biacore ® instrumentation to measure binding is to determine if binding between two molecules can be detected.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Was having the same issue where BindSignal does not get called in unit tests; dropping in to confirm that adding Container.ResolveRoots() solves the issue.
Once you have your signaled binded, try calling Container.ResolveRoots(); Also make sure you don’t have a [Setup] method that injects or resolves the signalbus.
In [Setup] you can call the installer there if you’d like
The example above were all doing this, but it will fail if SignalBus was also injected in [SetUp].