Category Archives: TypeMock

Upgrading from 5.3.1 to 5.3.4

For some strange reason when my existing projects referenced Type Mock and Type Mock Isolator it would mark Type Mock as copy local true and Isolator as false. However, after upgrading to 5.3.4 when I add a reference the opposite … Continue reading

Posted in TypeMock | Leave a comment

“Bad class token” when running (N) unit tests with TypeMock

Had a strange problem today, some of the automated build tests were failing with "Bad class token". However, when I went onto the build machine and ran them via NUnit GUI they worked fine. The difference is that we’d normally … Continue reading

Posted in TypeMock | Leave a comment

Testing ASP.NET Session state part 2

After publishing the first example I thought I’d better show how to check the actual values in the cache too…        static void Main(string[] args)        {            Page page = new Page();            MockManager.Init();            MockObject sessionMock = MockManager.MockObject(typeof(HttpSessionState));            Mock pageMock = MockManager.MockAll(page.GetType());            pageMock.ExpectGet("Session", … Continue reading

Posted in TypeMock | Leave a comment

Testing ASP.NET session cache

I was asked how to test the ASP.NET Page.Session object. I’m sure there are many ways of doing it, but here is my quick console sample using TypeMock;  static void Main(string[] args)        {            Page page = new Page();            MockManager.Init();            MockObject … Continue reading

Posted in TypeMock | Leave a comment

TypeMock and COM+

A colleague of mine ran into a problem testing a .net component (the server component). The underlying problem was that the .net component was deriving from Enterprise Services, i.e. it behaves like a COM+ component. I believe the issue here … Continue reading

Posted in TypeMock | Leave a comment

Mocking Framework

The projects I work on make use of Unit Testing via the NUnit Framework and the TestDriven Visual Studio addin. However, we haven’t made use of a Mocking Framework and I finally decided to have a look around and a … Continue reading

Posted in TypeMock | Leave a comment