ying-hui.the@windev.co.uk (47) [Avatar] Offline
#1
.. adding some more tests to the CountersViewModelTests unit test class as shown in listing 8.38 .

in listing 8.22, is a CountersViewModel viewModel;

in listing Listing 8.38. viewModel is implied to be a: CounterViewModel

whats my deliberate mistake?
Jim Bennett (88) [Avatar] Offline
#2
Can you provide more explanation please. I'm not sure what problem you are facing.
ying-hui.the@windev.co.uk (47) [Avatar] Offline
#3
well obviously i am working through the book adding bits at each stage. seeing the unit tests working great. then i go to a bit where nothing will compile, because things need defintions ahead of what I am reading, but like I said, listing 8.38 suposses that a type is one thing and a previous one says it something else.

So i'm just trying to get it working. Currently I think that line 2 in listing 8.38 might be


viewModel = new CountersViewModel(mockCountersService.Object, messenger.Object, mockNavigationService.Object);

Obviously I cant be sure ...

shall I send you my project? Can you send me the one that you know works.

Best

YH
Jim Bennett (88) [Avatar] Offline
#4
OK - makes more sense now. You are right.

In the setup it should be:

viewModel = new CountersViewModel(countersService.Object,
                                                              messenger.Object, 
                                                              navigationService.Object); 


Good spot - I've updated the book and it should be in the next MEAP release. Thanks!