Esempio n. 1
0
        public void CreateInvokeHttpClient_InvalidAppId()
        {
            var ex = Assert.Throws <ArgumentException>(() =>
            {
                // The appId needs to be something that can be used as hostname in a URI.
                _ = DaprClient.CreateInvokeHttpClient(appId: "");
            });

            Assert.Contains("The appId must be a valid hostname.", ex.Message);
            Assert.IsType <UriFormatException>(ex.InnerException);
        }
Esempio n. 2
0
        public DaprDataSource(string datasourcename, IDMLogger logger, IDMEEditor pDMEEditor, DataSourceType pDatasourceType, IErrorsInfo per)
        {
            DatasourceName = datasourcename;
            Logger         = logger;
            ErrorObject    = per;
            DMEEditor      = pDMEEditor;
            DatasourceType = pDatasourceType;
            Dataconnection = new WebAPIDataConnection
            {
                Logger      = logger,
                ErrorObject = ErrorObject,
            };

            Dataconnection.ConnectionProp = DMEEditor.ConfigEditor.DataConnections.Where(c => c.FileName == datasourcename).FirstOrDefault();

            Client = new DaprClientBuilder().Build();
            //var counter = await DaprClient.GetStateAsync<int>(StoreName, Key);
            Dataconnection.ConnectionStatus = ConnectionStatus;
            GetEntitesList();
        }
Esempio n. 3
0
        public void GetDaprApiTokenHeader_ApiTokenNotSet_NullApiTokenHeader()
        {
            var entry = DaprClient.GetDaprApiTokenHeader(null);

            Assert.Equal(default, entry);
Esempio n. 4
0
        public void CreateInvokeHttpClient_WithoutAppId()
        {
            var client = DaprClient.CreateInvokeHttpClient(daprEndpoint: "http://localhost:3500");

            Assert.Null(client.BaseAddress);
        }
Esempio n. 5
0
        public void CreateInvokeHttpClient_WithAppId()
        {
            var client = DaprClient.CreateInvokeHttpClient(appId: "bank", daprEndpoint: "http://localhost:3500");

            Assert.Equal("http://bank/", client.BaseAddress.AbsoluteUri);
        }
Esempio n. 6
0
 public ConsumerController(ILogger <ConsumerController> logger, Dapr.Client.DaprClient daprClient)
 {
     _logger = logger;
     _client = daprClient;
 }
Esempio n. 7
0
 public PublishController(ILogger <PublishController> logger, Dapr.Client.DaprClient daprClient)
 {
     _logger = logger;
     _client = daprClient;
 }