Exemplo n.º 1
0
        public async Task AddAlpha_Success()
        {
            var data    = GenerateData();
            var request = new AddAlphaRequest
            {
                Id   = Guid.NewGuid().ToString(),
                Data = { data }
            };

            var response = await client.AddAlphaAsync(request);

            Assert.NotNull(response);
            Assert.Equal(request.Id, response.Id);
        }
Exemplo n.º 2
0
        public override async Task <AddAlphaResponse> AddAlpha(AddAlphaRequest request, ServerCallContext context)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            logger.LogInformation(request.ToString());

            var response = new AddAlphaResponse
            {
                Id = request.Id
            };

            await Task.Delay(100);

            logger.LogInformation(response.ToString());

            return(response);
        }
Exemplo n.º 3
0
        public async Task <AddAlphaResponse> AddAlphaAsync(AddAlphaRequest request, CancellationToken cancellationToken = default)
        {
            var client = new Alpha.AlphaClient(channel);

            return(await client.AddAlphaAsync(request, cancellationToken : cancellationToken));
        }