예제 #1
0
        public async void RetrievesFinHealthIndicator()
        {
            KontomatikApi api = await LoginWithMockCredentials();

            string finHealtIndicator = await api.GetFinHealthIndicatorXml();

            Assert.Contains("<reply", finHealtIndicator);
        }
예제 #2
0
        private async Task runCommand(Dictionary <string, string> commandInfo, KontomatikApi api)
        {
            string Id          = commandInfo["id"];
            string apiResponse = "";
            string commandName = GetCommandName(Id);

            try
            {
                switch (commandName)
                {
                case "ImportOwnerDetails":
                    apiResponse = await api.GetOwnerDetailsXml();

                    break;

                case "ImportAccounts":
                    apiResponse = await api.GetAccountsXml();

                    break;

                case "ImportTransactions":
                    apiResponse = await api.GetTransactionsXml(commandInfo["iban"],
                                                               Convert.ToDateTime(commandInfo["since"]));

                    break;

                case "FinHealthIndicator":
                    apiResponse = await api.GetFinHealthIndicatorXml();

                    break;

                default:
                    this.SendToClient(Id, "", "Unrecognized command: " + Id);
                    break;
                }
                if (!String.IsNullOrEmpty(apiResponse))
                {
                    this.SendToClient(Id, apiResponse, null);
                }
            }
            catch (KontomatikException exception)
            {
                this.SendToClient(Id, "", exception.Message);
            }
        }