示例#1
0
        public void Initialize()
        {
            _methodCodeGen = A.Fake <IMethodCodeGenerator>();
            _handlerStore  = A.Fake <IHandlerStore>();

            _generator = new ServerStreamMethodGenerator(_methodCodeGen, _handlerStore);
        }
示例#2
0
        public void Initialize()
        {
            _methodCodeGen = A.Fake <IMethodCodeGenerator>();
            _handlerStore  = A.Fake <IHandlerStore>();

            _generator = new CommandQueryMethodGenerator(_methodCodeGen, _handlerStore);
        }
        public void Initialize()
        {
            _handler = A.Fake <IHandlerStore>();

            _config = new MapGrpcServiceConfiguration();

            _compiler = new DispatcherCompiler(_handler, _config);
        }
示例#4
0
        public void Initialize()
        {
            _callContext = TestServerCallContext.Create(_guid.ToString(),
                                                        null, DateTime.Now, null, CancellationToken.None, null, null, null, null, null, null);

            _handler    = A.Fake <IHandlerStore>();
            _dispatcher = A.Fake <IDispatcher>();

            _config = new MapGrpcServiceConfiguration();

            _compiler = new DispatcherCompiler(_handler, _config);
        }
示例#5
0
        public DispatcherCompiler(IHandlerStore handlerStore, MapGrpcServiceConfiguration configuration)
        {
            _configuration = configuration;

            var methodCodeGenerator = new MethodCodeGenerator();

            // build a chain of responsibility
            var bidiStream   = new BidiStreamMethodGenerator(methodCodeGenerator, handlerStore);
            var clientStream = new ClientStreamMethodGenerator(methodCodeGenerator, handlerStore);
            var serverStream = new ServerStreamMethodGenerator(methodCodeGenerator, handlerStore);
            var commandQuery = new CommandQueryMethodGenerator(methodCodeGenerator, handlerStore);

            bidiStream.NextGenerator   = clientStream;
            clientStream.NextGenerator = serverStream;
            serverStream.NextGenerator = commandQuery;

            _methodGenerator = bidiStream;
        }
示例#6
0
        public void Initialize()
        {
            _callContext = TestServerCallContext.Create(_guid.ToString(),
                                                        null, DateTime.Now, null, CancellationToken.None, null, null, null, null, null, null);

            _methodOneAttributes = new[]
            {
                new AuthorizeAttribute("my.policy.1")
                {
                    Roles = "my.role.1", AuthenticationSchemes = "my.scheme.1"
                },
                new AuthorizeAttribute("my.policy.2")
                {
                    Roles = "my.role.2", AuthenticationSchemes = "my.scheme.2"
                },
            };

            _methodTwoAttributes = new[]
            {
                new AuthorizeAttribute("my.policy.3")
                {
                    Roles = "my.role.3", AuthenticationSchemes = "my.scheme.3"
                },
                new AuthorizeAttribute("my.policy.4")
                {
                    Roles = "my.role.4", AuthenticationSchemes = "my.scheme.4"
                },
            };

            _handler    = A.Fake <IHandlerStore>();
            _dispatcher = A.Fake <IDispatcher>();

            _config = new MapGrpcServiceConfiguration();

            _compiler = new DispatcherCompiler(_handler, _config);
        }
 public BidiStreamMethodGenerator(IMethodCodeGenerator methodCodeGenerator, IHandlerStore handlerStore)
     : base(methodCodeGenerator)
 {
     _handlerStore = handlerStore;
 }
 public CommandQueryMethodGenerator(IMethodCodeGenerator methodCodeGenerator, IHandlerStore handlerStore)
     : base(methodCodeGenerator)
 {
     _handlerStore = handlerStore;
 }