mrpmorris / Fluxor

Fluxor is a zero boilerplate Flux/Redux library for Microsoft .NET and Blazor.
MIT License
1.27k stars 147 forks source link

Simple example for unit test #368

Closed ABIOLI-COM closed 1 year ago

ABIOLI-COM commented 1 year ago

It should be simple, but I cannot find the way to build up a unit test for a simple component using an IState.
The simplest test should be to just register a simple object with some values, to be automatically injected in the component, without all the fluxor infrastructure up and running.
I tried, but now I'm wondering if it's possible...
Thank you again.

mrpmorris commented 1 year ago
  1. Create a parameterized constructor that requires the dependencies
  2. Set the values from that
  3. Pass in mocks from your test
ABIOLI-COM commented 1 year ago

I didn't explain myself correctly, probably because I didn't understand well what I had to do myself.
I solved it, anyway.
Thank you.