Ejemplo n.º 1
0
        public void CreateInterceptAsyncGenericValueTaskEmitter()
        {
            // Given
            var(signature, type, interceptor) = CreateParameter <IFooGenericValueTaskValueTypeParameter>(
                methodName: nameof(IFooGenericValueTaskValueTypeParameter.MethodWithOneParameterAsync));
            var factory = new MethodEmitterFactory();

            // When
            var emitter = factory.CreateMethodEmitterFor(signature, type, interceptor);

            // Then
            Assert.NotNull(emitter);
            Assert.IsType <InterceptAsyncMethodEmitter <AsyncGenericValueTaskInvocation <int> > >(emitter);
        }
Ejemplo n.º 2
0
        public void CreateInterceptFuncEmitter()
        {
            // Given
            var(signature, type, interceptor) = CreateParameter <IFooFuncValueTypeParameterIn <int> >(
                methodName: nameof(IFooFuncValueTypeParameterIn <int> .MethodWithOneParameter));
            var factory = new MethodEmitterFactory();

            // When
            var emitter = factory.CreateMethodEmitterFor(signature, type, interceptor);

            // Then
            Assert.NotNull(emitter);
            Assert.IsType <InterceptFuncEmitter <int> >(emitter);
        }