Example #1
0
        public void SameTypeMustBeReturnedInCaseDoubleRegistration()
        {
            var proxyType1 = LazyProxyBuilder.GetType <ITestService>();
            var proxyType2 = LazyProxyBuilder.GetType <ITestService>();

            Assert.Equal(proxyType1, proxyType2);
        }
Example #2
0
        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);
        }
Example #3
0
 public void ExceptionMustBeThrownForBuildingProxyByClass()
 {
     Assert.Throws <NotSupportedException>(
         () => LazyProxyBuilder.GetType <AbstractTestService>());
 }
Example #4
0
        public void ProxyMustImplementInterface()
        {
            var proxyType = LazyProxyBuilder.GetType <ITestService>();

            Assert.Contains(typeof(ITestService), proxyType.GetInterfaces());
        }