chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
I think I've found a bug. This worked in 5.3.1 but it doesn't anymore in 5.3.4
Perhaps it's the other way around ;)

Here's the code under test:

public class CompanyControlViewPresenter : ContentPresenter<ICompanyControlView> 
   public override void OnViewInitialized()
      View.Project = this.Project;
      View.CompanyViewInfo = GetCompanyViewInfo(View.CompanyID);

   protected CompanyViewInfo GetCompanyViewInfo(Int32 companyid)
      return CompanyViewInfo.GetByCompanyId(companyid, SellusContext2.Current.Project.ProjectID, CultureInfo.CurrentUICulture);

Here's the test initialize, you probably should not worry about faking the HttpContext and SellusContext2 classes.

private ICompanyControlView _fakeViewMock;

public void TestInitialization()

    _fakeViewMock = Isolate.Fake.Instance<ICompanyControlView>();

Here's the test code. As said, it now fails under 5.3.4

public void Does_SetProject_When_CallingOnViewInitialized()
   // Arrange
   Isolate.WhenCalled(() => CompanyViewInfo.GetByCompanyId(0, 0, null)).WillReturn(null);
   ProjectDefinition p = new ProjectDefinition();

   // Act
   CompanyControlViewPresenter x = new CompanyControlViewPresenter();
   x.Project = p;
   x.View = _fakeViewMock;

   // Assert
   Isolate.Verify.WasCalledWithExactArguments(() => _fakeViewMock.Project = p);
asked by dvdstelt (5.3k points)

4 Answers

0 votes
Hi Dennis,

I couldn't reproduce it with similar code, I would like to try it on a repro solution. Let's take it offline.

Best Regards,
Typemock Support Team
answered by Elisha (12k points)
0 votes
I can't resolve the issue myself, it's just working in a really, really large VS2008 solution. But when I rebuild the classes and try to reproduce, it fails..

I'll have another look at it tomorrow. Until then, thanks for the swift response! :)
answered by dvdstelt (5.3k points)
0 votes
Hi Dennis,

Thanks! Looking forward to another confirmed bug :lol:
answered by gilz (14.5k points)
0 votes
I still have NO IDEA what causes the bug, but I'm the only PC on which it occurs. Build machine and other machines have no problem with it.

Only thing that's really different is that I'm running Win7 RTM where the others are running Vista or Win2008.
answered by dvdstelt (5.3k points)