public void IsProxyCheckerInstalled_ReturnsFalseWhenTypeLoadExceptionThrown() { //Arrange SetupInGac(); var target = new ApplicationContextProvider(); MSPUtility.ExecuteRegisteredProxyOperationStringStringSPProxyOperationArgs = (a, t, args) => { throw new TypeLoadException(); }; //Act bool result = target.IsProxyCheckerInstalled(); //Assert Assert.IsFalse(result); }
public void IIsProxyCheckerInstalled_ReturnsFalse_WhenNotInGac() { //Arrange MCodeAccessPermission mock; MSecurityPermission.ConstructorSecurityPermissionFlag = (instance, flags) => { mock = new MCodeAccessPermission(instance) { Assert = () => { throw new SecurityException(); } }; }; var target = new ApplicationContextProvider(); //Act bool result = target.IsProxyCheckerInstalled(); //Assert Assert.IsFalse(result); }