public void SameTypeMustBeReturnedInCaseDoubleRegistration() { var proxyType1 = LazyProxyBuilder.GetType <ITestService>(); var proxyType2 = LazyProxyBuilder.GetType <ITestService>(); Assert.Equal(proxyType1, proxyType2); }
public void GenericInterfaceWithDifferentTypeParametersMustBeCreatedWithoutExceptions() { var exception = Record.Exception(() => { LazyProxyBuilder.GetType(typeof(IGenericTestService <, ,>)); LazyProxyBuilder.GetType <IGenericTestService <TestArgument2, TestArgument, TestArgument4> >(); LazyProxyBuilder.GetType <IGenericTestService <TestArgument3, TestArgument, TestArgument4> >(); }); Assert.Null(exception); }
public void ExceptionMustBeThrownForBuildingProxyByClass() { Assert.Throws <NotSupportedException>( () => LazyProxyBuilder.GetType <AbstractTestService>()); }
public void ProxyMustImplementInterface() { var proxyType = LazyProxyBuilder.GetType <ITestService>(); Assert.Contains(typeof(ITestService), proxyType.GetInterfaces()); }