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
One would expect this test to pass. It fails.
The recorder.CallStaticConstructors() has been removed
and the Assert inverted compare with the sample MockProductWithStaticConstructor

        [TestMethod()]
        public void MockProductWithOutStaticConstructor()
        {
            // Start Mocking
            using (RecordExpectations recorder = RecorderManager.StartRecording())
            {
                // Let mock the product - this will mock the next invocation of Product,
                // Lets mock the constructor - but not static constructor
                Product mockProduct = new Product();
            }
            // END OF MOCK SETUP

            // Lets get a new Product
            Product product = new Product();
            // Just name is default
            // Note: if the static constructor was not mocked before this will fail 
            Assert.AreNotEqual("default", product.DefaultName);
        }
[quote][/quote]
asked by krok (3.9k points)

2 Answers

0 votes
Hi Arnulf,

As you say, the test should work. We'll check this and get back to you.
answered by gilz (14.5k points)
0 votes
Hi Everyone,

We've got the problem resolved on v4.3. You can download it from:https://www.typemock.com/Downloads.php
answered by gilz (14.5k points)
...