Пример #1
0
        public void SameTypeMustBeReturnedInCaseDoubleRegistration()
        {
            var proxyType1 = LazyProxyBuilder.GetType <ITestService>();
            var proxyType2 = LazyProxyBuilder.GetType <ITestService>();

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

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