It is currently Sat Nov 01, 2014 1:48 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Sun Nov 05, 2006 1:32 pm 
Offline
Moderator
Moderator

Joined: Thu Sep 28, 2006 6:41 am
Posts: 305
Hi,
I want to create a small test that checks that Class A in his constructor create an object of class B. for this I am using on the mocked class the ExpectConstructor() method and for some reason the test passes even i no call the to the constructor is made.

what am I doing wrong? (or is this a bug?)

here is a sample code:

Code:
    public class B
    {    }
    public class A
    {
        public A()
        {
            //here there should be a call to create an object of class B
        }
    }

        [TestMethod()]
        public void ctorTest()
        {
            MockManager.Init();
            Mock b = MockManager.Mock(typeof(B));
            b.ExpectConstructor();

            A target = new A();

            MockManager.Verify();
        }


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 05, 2006 3:09 pm 
Offline
Site Admin
Site Admin

Joined: Thu May 18, 2006 12:03 pm
Posts: 907
Hi
This is a known bug.
The fix will be in available in our next release.
I will send you the patch offline as soon as it will be ready.

_________________
Regards

Ohad,
TypeMock Support Group


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 07, 2006 10:38 am 
Offline
Moderator
Moderator

Joined: Thu Sep 28, 2006 6:41 am
Posts: 305
thank you


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 26, 2006 4:49 pm 
Offline
Moderator
Moderator

Joined: Thu Sep 28, 2006 6:41 am
Posts: 305
Any estimated target date for this fix?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 27, 2006 7:59 am 
Offline
Moderator
Moderator

Joined: Sun Jan 09, 2005 11:08 pm
Posts: 753
Hi,
I must first correct, this is not a BUG. This is a feature that we have not implemented yet.
Currently ExpectConstructor is used to validate constructor arguments.

We do have plans to expand the features of the constructors to support:
:arrow: chained constructors (one constructor calling another),
:arrow: verifying that a constructor was actually called
and more.
This should be implemented in our next release that will be out in the beginning of next year.

If you wish, we will send you a preview, once the feature is complete.

_________________
Regards

Scott,
TypeMock Support Group


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 12, 2006 4:01 pm 
Offline
Site Admin
Site Admin

Joined: Thu May 18, 2006 12:03 pm
Posts: 907
Hi Lior
A patch was created and sent.

_________________
Regards

Ohad,
TypeMock Support Group


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group