public void DoubleGeneric() { string clrInstallationDir = Path.GetDirectoryName(typeof(object).Assembly.Location); string mscorwksFilename = Path.Combine(clrInstallationDir, "mscorwks.dll"); FileVersionInfo clrVersion = FileVersionInfo.GetVersionInfo(mscorwksFilename); if (clrVersion.ProductMajorPart == 2 && clrVersion.ProductMinorPart == 0 && clrVersion.ProductBuildPart == 50727) { // CLR 2.0, now need to check if we have the .NET 3.5 with SP1 installed, // without the hotfix if (clrVersion.ProductPrivatePart >= 3053 && clrVersion.ProductPrivatePart < 3068) { //"You are running on .NET 3.5 SP1, without the KB 957542 hotfix. This version of the CLR has a bug that cause this test to fail"); return; } } IDoubleGeneric <int> mock = MockRepository.Mock <IDoubleGeneric <int> >(); mock.SetUnexpectedBehavior(UnexpectedCallBehaviors.BaseOrDefault); mock.Expect(x => x.Method <string>(1, "")); }
public void GenericClassWithGenericMethodWitoutTarget() { var interceptor = new SetReturnValueInterceptor(3); IDoubleGeneric <int> proxy = (IDoubleGeneric <int>)generator.CreateInterfaceProxyWithoutTarget(typeof(IDoubleGeneric <int>), interceptor); object o = proxy.Call(1, ""); Assert.AreEqual(3, o); }
public void GenericClassWithGenericMethod() { LogInvocationInterceptor logger = new LogInvocationInterceptor(); IDoubleGeneric <int> proxy = (IDoubleGeneric <int>)generator.CreateInterfaceProxyWithTarget(typeof(IDoubleGeneric <int>), new DoubleGenericImpl <int>(), logger); proxy.Call <string>(1, ""); Assert.AreEqual("Call", logger.Invocations[0]); }
public ThreeEmptyServiceDependenciesPropertyAndManyCtors(IEmptyService one, IDoubleGeneric <int, A> two) { One = one; Two = two; }
public ThreeEmptyServiceDependenciesPropertyAndManyCtors(IEmptyService one, IDoubleGeneric<int, A> two) { One = one; Two = two; }