public async Task Should_make_request_with_json_serializer()
        {
            var cluster =
                new TestClusterBuilder(1)
                .Build();

            await cluster.DeployAsync();

            try
            {
                for (var i = 0; i < 100; i++)
                {
                    var id = DomainId.NewGuid().ToString();

                    var grain = cluster.GrainFactory.GetGrain <ICommandGrain>(id);

                    var result = await grain.ExecuteAsync(CommandRequest.Create(new TestCommand
                    {
                        Value = id
                    }));

                    Assert.Equal(id, result.Value.Payload);
                }
            }
            finally
            {
                await Task.WhenAny(Task.Delay(2000), cluster.StopAllSilosAsync());
            }
        }
示例#2
0
        private Task ExecuteCreateAsync()
        {
            var command = CreateCommand(new CreateAsset {
                AssetId = assetId, File = file
            });

            return(asset.ExecuteAsync(CommandRequest.Create(command)));
        }
示例#3
0
 public T PrepareCommand <T>(int port) where T : CommandRequest <ICamera>
 {
     return(CommandRequest <ICamera> .Create <T>(this, string.Format("{0}:{1}", Bacpac.Address, port), passPhrase : Bacpac.Password));
 }
示例#4
0
 public T PrepareCommand <T>() where T : CommandRequest <ICamera>
 {
     return(CommandRequest <ICamera> .Create <T>(this, Bacpac.Address, passPhrase : Bacpac.Password));
 }
示例#5
0
        private T CreateCommand <T>(string parameter = null) where T : CommandRequest <Bacpac>
        {
            var request = CommandRequest <Bacpac> .Create <T>(this, Address, passPhrase : Password, parameter : parameter);

            return(request);
        }