New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ReactiveCommand doesn't seem to handle inital false state #32
Comments
So, the code below isn't surprising if you're outside of a unit test runner because we end up updating things on the Dispatcher - so, if you change something then instantly check for it, it's not up-to-date (in the unit test runner, the default Scheduler is changed so that tests like this are possible to write). Can you show me your code that tries to do this, it should look something like (coding via Email ahead): var theCmd = new ReactiveCommand( One big difference between WhenAny and ObservableForProperty, is that WhenAny sends a notification when you first set it up, so it solves the "initial state" problem, whereas with ObsForProp you would always have to tack on .StartWith(TheProperty) Paul Betts paul@paulbetts.org On Thursday, August 25, 2011 at 1:32 PM, alski wrote:
|
OK, l think I might know what's wrong. I'm using nbehave to test with. Is that going to be recognised as a runner? Just in case, my code is below including the debug Do()s. I'm sure it had a StartWith before :-) AddCommand = new ReactiveCommand( |
Not currently, but I'll add it. In the meantime, if you put at the top of your test: RxApp.DeferredScheduler = Scheduler.Immediate; That should unblock you Paul Betts SENT FROM MY COMMODORE 64: RESPONSES MAY BE IN ALL CAPS On Aug 26, 2011, at 3:45, alskireply@reply.github.com wrote:
|
Ok, so if I add a referenec to nUnit and wrap my existing test code with using NUnit.Framework; Then I can confirm that the tests pass in an NUnit Gui, via TestDriven.Net's Run Test and NBehave's Run Scenario. When I remove the [Test] everything works (except in nUnit Gui) which can't find a test (still getting the Error under TestDriven) When I remove the [TestFixture] nBehave RunScenario fails independant of the fact the nUnit assemblies are still referenced. Would that imply because nUnit isn't actually used its not been loaded? |
Could it be as simple as changing the code under RxApp.InUnitTestRunner() ? I agree with your comment, I can't think of a better way either. |
Yes, assembly loading is lazy - the loaded assemblies list won't reflect referenced assemblies that aren't being used, so it won't be picked up Paul Betts SENT FROM MY COMMODORE 64: RESPONSES MAY BE IN ALL CAPS On Aug 26, 2011, at 11:41, alskireply@reply.github.com wrote:
|
I have a UI where an empty text box prevents an OK button being clicked, but unfortunately it seems to be enabled until after you have set and cleared the textbox. After stripping it down and down I can still recreate the issue with code as simple as
Following the ReactiveCommand constructor in the source, it seems to be that the InitialValue is being set to true. Can you remember the reason for this? Is there anyway we can detect an initial value from the observable that we are watching?
The text was updated successfully, but these errors were encountered: