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
0 votes
hi

i trying to fake OracleDataReader like that:
           OracleDataReader fakeOracleDataReader = 
                Isolate.Fake.Instance<OracleDataReader>(
                    Members.ReturnRecursiveFakes, 
                    ConstructorWillBe.Ignored, 
                    BaseConstructorWillBe.Ignored);

also tried with any parameters combinations,
but i keep receiving a NullReferenceException:
Test method MayorDAL.Test.DatabaseServicesTest.InitializeMetadataReverseCompatibilityTest threw exception: System.NullReferenceException: Object reference not set to an instance of an object..

Stack Trace:
Oracle.DataAccess.Client.OracleDataReader..ctor(OracleConnection connection, IntPtr[] opsSqlCtx, IntPtr opsDacCtx, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, OpoDacValCtx* pOpoDacValCtx, MetaData metaData, Int32 resultCount, CommandBehavior commandBehavior, Hashtable safeMapping, String commandText, Int32 freeOpsSqlCtx)
gh.CreateFakeInstance[T](Members behavior, Constructor constructorFlag, Constructor baseConstructorFlag, Type baseType, Object[] ctorArgs)
gh.Instance[T](Members behavior, ConstructorWillBe constructorBehavior, BaseConstructorWillBe baseConstructorBehavior)
MayorDAL.Test.DatabaseServicesTest.InitializeMetadataReverseCompatibilityTest() in C:ProjectsTfsRootOperationalDevelopmentMayorMayorDAL.TestDatabaseServicesTestDatabaseServicesTest[Shared].cs: line 269
TypeMock.MockManager.a(String A_0, String A_1, Object A_2, Object A_3, Boolean A_4, Object[] A_5)
TypeMock.InternalMockManager.getReturn(Object that, String typeName, String methodName, Object methodParameters, Boolean isInjected)
MayorDAL.Test.DatabaseServicesTest.InitializeMetadataReverseCompatibilityTest() in C:ProjectsTfsRootOperationalDevelopmentMayorMayorDAL.TestDatabaseServicesTestDatabaseServicesTest[Shared].cs: line 0

Used environment:
Windows XP SP3 x86
Microsoft Visual Studio 2008 Developer Edition
Typemock Isolator 5.4.4.0.222 x86
Oracle Client 11g (ODP.NET, Oracle.DataAccess.dll version 2.111.6.20)
asked by mod (5.8k points)

2 Answers

0 votes
Hi,

I tried to recreate this behavior locally and it did not happen. Can you create a small reproducing solution and send it to support (at) typemock.com?

Thanks,
Doron
Typemock Support
answered by doron (17.2k points)
0 votes
Hi,

The bug is confirmed and it's now in our backlog.
answered by NofarC (4k points)
...