From e231691b2391aa7551c12aabad4d9167bc1aa2d8 Mon Sep 17 00:00:00 2001 From: Jake Moening Date: Wed, 4 Sep 2019 11:22:07 -0500 Subject: [PATCH] #3 Added a Create Transaction Test --- YNAB.SDK.Tests/YNAB_BudgetsShould.cs | 8 +- YNAB.SDK.Tests/YNAB_ExamplesShould.cs | 4 +- YNAB.SDK.Tests/YnabApiStub.cs | 13 + ...5-4cf6-9fa6-92c34ed44b0c_transactions.json | 364 ++++++++++++++++++ YNAB.SDK/Api/TransactionsApi.cs | 60 +-- YNAB.SDK/examples/CreateTransaction.cs | 28 +- 6 files changed, 439 insertions(+), 38 deletions(-) create mode 100644 YNAB.SDK.Tests/stub-responses/budgets__14235236-8085-4cf6-9fa6-92c34ed44b0c_transactions.json diff --git a/YNAB.SDK.Tests/YNAB_BudgetsShould.cs b/YNAB.SDK.Tests/YNAB_BudgetsShould.cs index 350c00f..221667c 100644 --- a/YNAB.SDK.Tests/YNAB_BudgetsShould.cs +++ b/YNAB.SDK.Tests/YNAB_BudgetsShould.cs @@ -14,12 +14,16 @@ public YNAB_BudgetsShould() { } [Fact] - public void Budgets_FailWithBadAccessTokens() { + public async Task Budgets_FailWithBadAccessTokens() { // Arrange var badToken = "INVALID_TOKEN"; - var ynabApi = new YNAB.SDK.API(badToken); + var goodToken = Environment.GetEnvironmentVariable("YNAB_TEST_TOKEN"); + var ynabApi = new YNAB.SDK.API(goodToken); // Act + var ct = new YNAB.SDK.Examples.CreateTransaction(ynabApi); + ct.Execute(); + //await ct.ExecuteAsync(); // Assert Assert.Throws(() => { ynabApi.Budgets.GetBudgets(); diff --git a/YNAB.SDK.Tests/YNAB_ExamplesShould.cs b/YNAB.SDK.Tests/YNAB_ExamplesShould.cs index 2c25c2f..7fe1c1e 100644 --- a/YNAB.SDK.Tests/YNAB_ExamplesShould.cs +++ b/YNAB.SDK.Tests/YNAB_ExamplesShould.cs @@ -53,8 +53,8 @@ public async Task Examples_RunSuccessfully() { // await cmt.ExecuteAsync(); var ct = new CreateTransaction(api); - // ct.Execute(); - // await ct.ExecuteAsync(); + ct.Execute(); + await ct.ExecuteAsync(); var dre = new DeltaRequestExample(api); dre.Execute(); diff --git a/YNAB.SDK.Tests/YnabApiStub.cs b/YNAB.SDK.Tests/YnabApiStub.cs index 00b7956..4d0cf02 100644 --- a/YNAB.SDK.Tests/YnabApiStub.cs +++ b/YNAB.SDK.Tests/YnabApiStub.cs @@ -41,6 +41,13 @@ public YnabApiStub(int? port = null, bool useDefaultResponses = true) { ) .AddDefaultHeaders(); } + var postEndpoint = "budgets/14235236-8085-4cf6-9fa6-92c34ed44b0c/transactions"; + _stub.Post( + $"/{postEndpoint}", + (req, args) => { + return "{\"data\":{\"transaction_ids\":[\"013a8128-d78f-42ff-a59e-633a4c75253e\"],\"transaction\":{\"id\":\"013a8128-d78f-42ff-a59e-633a4c75253e\",\"date\":\"2019-09-04\",\"amount\":100,\"memo\":\"TEST\",\"cleared\":\"cleared\",\"approved\":true,\"flag_color\":\"red\",\"account_id\":\"09c21bf0-8bd0-4b7b-b158-4fe2df899991\",\"account_name\":\"Checking Account\",\"payee_id\":\"51b1c8ad-f51e-4782-a0dc-f1b2b2cadd61\",\"payee_name\":\"Starting Balance\",\"category_id\":\"6e6c1877-6fa7-461a-8f5f-0aadf361f8cd\",\"category_name\":\"Immediate Income SubCategory\",\"transfer_account_id\":null,\"transfer_transaction_id\":null,\"matched_transaction_id\":null,\"import_id\":null,\"deleted\":false,\"subtransactions\":[]},\"server_knowledge\":174}}"; + } + ); } } @@ -78,6 +85,12 @@ public void AddGetRequest(string relativePath, Stubbery.RequestMatching.CreateSt .AddDefaultHeaders(); } + public void AddPostRequest(string relativePath, Stubbery.RequestMatching.CreateStubResponse response) + { + _stub.Post(relativePath, response) + .AddDefaultHeaders(); + } + /// /// Tear down the stub /// diff --git a/YNAB.SDK.Tests/stub-responses/budgets__14235236-8085-4cf6-9fa6-92c34ed44b0c_transactions.json b/YNAB.SDK.Tests/stub-responses/budgets__14235236-8085-4cf6-9fa6-92c34ed44b0c_transactions.json new file mode 100644 index 0000000..323ed9a --- /dev/null +++ b/YNAB.SDK.Tests/stub-responses/budgets__14235236-8085-4cf6-9fa6-92c34ed44b0c_transactions.json @@ -0,0 +1,364 @@ +{ + "data": { + "transactions": [ + { + "id": "0a323ef2-75a5-430b-9a4b-84d89bb07824", + "date": "2019-08-01", + "amount": -1000000, + "memo": "", + "cleared": "cleared", + "approved": true, + "flag_color": null, + "account_id": "09c21bf0-8bd0-4b7b-b158-4fe2df899991", + "account_name": "Checking Account", + "payee_id": "33852191-3280-4218-91fc-bf634ef125a2", + "payee_name": "Mortgages, Inc.", + "category_id": "3b89df53-1869-4d2f-a636-d09eadc3f0ca", + "category_name": "Rent/Mortgage", + "transfer_account_id": null, + "transfer_transaction_id": null, + "matched_transaction_id": null, + "import_id": null, + "deleted": false, + "subtransactions": [] + }, + { + "id": "47e6a621-a96c-4a8e-8a1a-0916924110c6", + "date": "2019-08-01", + "amount": -100000, + "memo": "", + "cleared": "cleared", + "approved": true, + "flag_color": null, + "account_id": "09c21bf0-8bd0-4b7b-b158-4fe2df899991", + "account_name": "Checking Account", + "payee_id": "26a7c66d-681e-4217-8303-f651e3bf4e07", + "payee_name": "Electricity Corp.", + "category_id": "18c9d91e-3e37-498c-a1ca-5d939a4fd16e", + "category_name": "Electric", + "transfer_account_id": null, + "transfer_transaction_id": null, + "matched_transaction_id": null, + "import_id": null, + "deleted": false, + "subtransactions": [] + }, + { + "id": "f977042f-cd0f-4c12-9418-a7c1f0ba7b55", + "date": "2019-08-01", + "amount": -60000, + "memo": null, + "cleared": "cleared", + "approved": true, + "flag_color": null, + "account_id": "09c21bf0-8bd0-4b7b-b158-4fe2df899991", + "account_name": "Checking Account", + "payee_id": "e441fb6f-5783-47c7-bddb-20c6773c2bcf", + "payee_name": "Fuel Stop", + "category_id": "1f955447-dd45-41ee-a304-05db162a8959", + "category_name": "Transportation", + "transfer_account_id": null, + "transfer_transaction_id": null, + "matched_transaction_id": null, + "import_id": null, + "deleted": false, + "subtransactions": [] + }, + { + "id": "f0096520-d986-4497-8e87-d9b868ab3633", + "date": "2019-08-02", + "amount": -70000, + "memo": "", + "cleared": "cleared", + "approved": true, + "flag_color": null, + "account_id": "09c21bf0-8bd0-4b7b-b158-4fe2df899991", + "account_name": "Checking Account", + "payee_id": "cbf99763-07da-46d8-8063-edc438c4798c", + "payee_name": "Cable Mega Corp", + "category_id": "11108334-8a97-4f11-b162-fab229e6b4e0", + "category_name": "Internet", + "transfer_account_id": null, + "transfer_transaction_id": null, + "matched_transaction_id": null, + "import_id": null, + "deleted": false, + "subtransactions": [] + }, + { + "id": "da44406c-6ea6-4cad-95f0-1864e1b1dd02", + "date": "2019-08-03", + "amount": 1800000, + "memo": "", + "cleared": "cleared", + "approved": true, + "flag_color": null, + "account_id": "09c21bf0-8bd0-4b7b-b158-4fe2df899991", + "account_name": "Checking Account", + "payee_id": "6e3337bf-73a0-4151-b769-eaec304aa668", + "payee_name": "Photo Shoot", + "category_id": "6e6c1877-6fa7-461a-8f5f-0aadf361f8cd", + "category_name": "Immediate Income SubCategory", + "transfer_account_id": null, + "transfer_transaction_id": null, + "matched_transaction_id": null, + "import_id": null, + "deleted": false, + "subtransactions": [] + }, + { + "id": "797e5e6f-16ed-457f-94f7-6268abfe13b2", + "date": "2019-08-04", + "amount": 1200000, + "memo": null, + "cleared": "cleared", + "approved": true, + "flag_color": null, + "account_id": "09c21bf0-8bd0-4b7b-b158-4fe2df899991", + "account_name": "Checking Account", + "payee_id": "6e3337bf-73a0-4151-b769-eaec304aa668", + "payee_name": "Photo Shoot", + "category_id": "6e6c1877-6fa7-461a-8f5f-0aadf361f8cd", + "category_name": "Immediate Income SubCategory", + "transfer_account_id": null, + "transfer_transaction_id": null, + "matched_transaction_id": null, + "import_id": null, + "deleted": false, + "subtransactions": [] + }, + { + "id": "856264b5-bd58-4963-baf8-623afb2ae1bd", + "date": "2019-08-08", + "amount": -80000, + "memo": "", + "cleared": "cleared", + "approved": true, + "flag_color": null, + "account_id": "09c21bf0-8bd0-4b7b-b158-4fe2df899991", + "account_name": "Checking Account", + "payee_id": "059d13a3-ef77-4b44-a67a-e14292efce15", + "payee_name": "Renter's Insurance, LLC", + "category_id": "abd534ba-376d-4607-8b78-c26ec8076599", + "category_name": "Renter's/Home Insurance", + "transfer_account_id": null, + "transfer_transaction_id": null, + "matched_transaction_id": null, + "import_id": null, + "deleted": false, + "subtransactions": [] + }, + { + "id": "57804111-2ada-4b95-85ac-b0e4193799fe", + "date": "2019-08-10", + "amount": -48000, + "memo": "", + "cleared": "cleared", + "approved": true, + "flag_color": null, + "account_id": "09c21bf0-8bd0-4b7b-b158-4fe2df899991", + "account_name": "Checking Account", + "payee_id": "e441fb6f-5783-47c7-bddb-20c6773c2bcf", + "payee_name": "Fuel Stop", + "category_id": "1f955447-dd45-41ee-a304-05db162a8959", + "category_name": "Transportation", + "transfer_account_id": null, + "transfer_transaction_id": null, + "matched_transaction_id": null, + "import_id": null, + "deleted": false, + "subtransactions": [] + }, + { + "id": "122833a9-867b-48a4-b86a-c26c716f5bd8", + "date": "2019-08-11", + "amount": -210000, + "memo": "", + "cleared": "cleared", + "approved": true, + "flag_color": null, + "account_id": "09c21bf0-8bd0-4b7b-b158-4fe2df899991", + "account_name": "Checking Account", + "payee_id": "ed23df52-d8c0-41c9-8f36-cdec359aca94", + "payee_name": "Fresh Foods Market", + "category_id": "9fe92192-264a-4506-ba7e-796ae30de156", + "category_name": "Groceries", + "transfer_account_id": null, + "transfer_transaction_id": null, + "matched_transaction_id": null, + "import_id": null, + "deleted": false, + "subtransactions": [] + }, + { + "id": "fd651b94-59b6-451b-8e6e-977dfc873a20", + "date": "2019-08-12", + "amount": -38000, + "memo": null, + "cleared": "cleared", + "approved": true, + "flag_color": null, + "account_id": "09c21bf0-8bd0-4b7b-b158-4fe2df899991", + "account_name": "Checking Account", + "payee_id": "e441fb6f-5783-47c7-bddb-20c6773c2bcf", + "payee_name": "Fuel Stop", + "category_id": "1f955447-dd45-41ee-a304-05db162a8959", + "category_name": "Transportation", + "transfer_account_id": null, + "transfer_transaction_id": null, + "matched_transaction_id": null, + "import_id": null, + "deleted": false, + "subtransactions": [] + }, + { + "id": "03bca3b5-7843-4800-96ce-3aa49f0cbdd8", + "date": "2019-08-15", + "amount": -147000, + "memo": "", + "cleared": "cleared", + "approved": true, + "flag_color": null, + "account_id": "09c21bf0-8bd0-4b7b-b158-4fe2df899991", + "account_name": "Checking Account", + "payee_id": "ed23df52-d8c0-41c9-8f36-cdec359aca94", + "payee_name": "Fresh Foods Market", + "category_id": "9fe92192-264a-4506-ba7e-796ae30de156", + "category_name": "Groceries", + "transfer_account_id": null, + "transfer_transaction_id": null, + "matched_transaction_id": null, + "import_id": null, + "deleted": false, + "subtransactions": [] + }, + { + "id": "8e63e9a5-cc44-4c4d-a810-13d35e602806", + "date": "2019-08-16", + "amount": -12000, + "memo": "Buck Spot", + "cleared": "cleared", + "approved": true, + "flag_color": null, + "account_id": "09c21bf0-8bd0-4b7b-b158-4fe2df899991", + "account_name": "Checking Account", + "payee_id": "12a7f7a2-52b8-46af-935c-c2368eb56e52", + "payee_name": "Tergat", + "category_id": "5f482d87-5ef6-43d1-b41f-c8d83db1eecf", + "category_name": "Stuff I Forgot to Budget For", + "transfer_account_id": null, + "transfer_transaction_id": null, + "matched_transaction_id": null, + "import_id": null, + "deleted": false, + "subtransactions": [] + }, + { + "id": "5ae6ec89-6607-451e-8c5b-95e937da1749", + "date": "2019-08-17", + "amount": -125000, + "memo": "", + "cleared": "cleared", + "approved": true, + "flag_color": null, + "account_id": "09c21bf0-8bd0-4b7b-b158-4fe2df899991", + "account_name": "Checking Account", + "payee_id": "ed23df52-d8c0-41c9-8f36-cdec359aca94", + "payee_name": "Fresh Foods Market", + "category_id": "9fe92192-264a-4506-ba7e-796ae30de156", + "category_name": "Groceries", + "transfer_account_id": null, + "transfer_transaction_id": null, + "matched_transaction_id": null, + "import_id": null, + "deleted": false, + "subtransactions": [] + }, + { + "id": "db1ab731-b26e-4412-9b79-0dd9042b50b4", + "date": "2019-08-19", + "amount": -100000, + "memo": "", + "cleared": "cleared", + "approved": true, + "flag_color": null, + "account_id": "09c21bf0-8bd0-4b7b-b158-4fe2df899991", + "account_name": "Checking Account", + "payee_id": "18f7dc2d-994b-499a-9b0d-ca897f00ce1b", + "payee_name": "Vampire Loans", + "category_id": "a5d72265-2f79-4b37-a1bd-2a392f9bfa2c", + "category_name": "Student Loan", + "transfer_account_id": null, + "transfer_transaction_id": null, + "matched_transaction_id": null, + "import_id": null, + "deleted": false, + "subtransactions": [] + }, + { + "id": "828e0482-a09a-46c1-a34b-c4d7780fb7fb", + "date": "2019-08-20", + "amount": -60000, + "memo": "", + "cleared": "cleared", + "approved": true, + "flag_color": null, + "account_id": "09c21bf0-8bd0-4b7b-b158-4fe2df899991", + "account_name": "Checking Account", + "payee_id": "e441fb6f-5783-47c7-bddb-20c6773c2bcf", + "payee_name": "Fuel Stop", + "category_id": "1f955447-dd45-41ee-a304-05db162a8959", + "category_name": "Transportation", + "transfer_account_id": null, + "transfer_transaction_id": null, + "matched_transaction_id": null, + "import_id": null, + "deleted": false, + "subtransactions": [] + }, + { + "id": "17e881e0-97b4-486a-94db-60f3942dbfa3", + "date": "2019-08-23", + "amount": -30000, + "memo": "", + "cleared": "cleared", + "approved": true, + "flag_color": null, + "account_id": "09c21bf0-8bd0-4b7b-b158-4fe2df899991", + "account_name": "Checking Account", + "payee_id": "e441fb6f-5783-47c7-bddb-20c6773c2bcf", + "payee_name": "Fuel Stop", + "category_id": "668a7170-8ed1-487c-b682-8993a0ff7ee3", + "category_name": "Dining Out", + "transfer_account_id": null, + "transfer_transaction_id": null, + "matched_transaction_id": null, + "import_id": null, + "deleted": false, + "subtransactions": [] + }, + { + "id": "bea995f5-4217-4fa3-9a4b-d3e47b99b0ec", + "date": "2019-08-29", + "amount": -45000, + "memo": "", + "cleared": "cleared", + "approved": true, + "flag_color": null, + "account_id": "09c21bf0-8bd0-4b7b-b158-4fe2df899991", + "account_name": "Checking Account", + "payee_id": "e441fb6f-5783-47c7-bddb-20c6773c2bcf", + "payee_name": "Fuel Stop", + "category_id": "1f955447-dd45-41ee-a304-05db162a8959", + "category_name": "Transportation", + "transfer_account_id": null, + "transfer_transaction_id": null, + "matched_transaction_id": null, + "import_id": null, + "deleted": false, + "subtransactions": [] + } + ], + "server_knowledge": 168 + } +} diff --git a/YNAB.SDK/Api/TransactionsApi.cs b/YNAB.SDK/Api/TransactionsApi.cs index a5354ee..58ea180 100644 --- a/YNAB.SDK/Api/TransactionsApi.cs +++ b/YNAB.SDK/Api/TransactionsApi.cs @@ -1,10 +1,10 @@ -/* +/* * YNAB API Endpoints * * Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.youneedabudget.com * * The version of the OpenAPI document: 1.0.0 - * + * * Generated by: https://github.com/openapitools/openapi-generator.git */ @@ -682,13 +682,13 @@ public async System.Threading.Tasks.Task CreateTransac String[] @accepts = new String[] { "application/json" }; - - foreach (var contentType in @contentTypes) - requestOptions.HeaderParameters.Add("Content-Type", contentType); - - foreach (var accept in @accepts) - requestOptions.HeaderParameters.Add("Accept", accept); - + + var localVarContentType = YNAB.SDK.Client.ClientUtils.SelectHeaderContentType(@contentTypes); + if (localVarContentType != null) requestOptions.HeaderParameters.Add("Content-Type", localVarContentType); + + var localVarAccept = YNAB.SDK.Client.ClientUtils.SelectHeaderAccept(@accepts); + if (localVarAccept != null) requestOptions.HeaderParameters.Add("Accept", localVarAccept); + if (budgetId != null) requestOptions.PathParameters.Add("budget_id", YNAB.SDK.Client.ClientUtils.ParameterToString(budgetId)); // path parameter requestOptions.Data = data; @@ -823,13 +823,13 @@ public async System.Threading.Tasks.Task GetTransactionById String[] @accepts = new String[] { "application/json" }; - + foreach (var contentType in @contentTypes) requestOptions.HeaderParameters.Add("Content-Type", contentType); - + foreach (var accept in @accepts) requestOptions.HeaderParameters.Add("Accept", accept); - + if (budgetId != null) requestOptions.PathParameters.Add("budget_id", YNAB.SDK.Client.ClientUtils.ParameterToString(budgetId)); // path parameter if (transactionId != null) @@ -993,13 +993,13 @@ public async System.Threading.Tasks.Task GetTransactionsAs String[] @accepts = new String[] { "application/json" }; - + foreach (var contentType in @contentTypes) requestOptions.HeaderParameters.Add("Content-Type", contentType); - + foreach (var accept in @accepts) requestOptions.HeaderParameters.Add("Accept", accept); - + if (budgetId != null) requestOptions.PathParameters.Add("budget_id", YNAB.SDK.Client.ClientUtils.ParameterToString(budgetId)); // path parameter if (sinceDate != null) @@ -1205,13 +1205,13 @@ public async System.Threading.Tasks.Task GetTransactionsBy String[] @accepts = new String[] { "application/json" }; - + foreach (var contentType in @contentTypes) requestOptions.HeaderParameters.Add("Content-Type", contentType); - + foreach (var accept in @accepts) requestOptions.HeaderParameters.Add("Accept", accept); - + if (budgetId != null) requestOptions.PathParameters.Add("budget_id", YNAB.SDK.Client.ClientUtils.ParameterToString(budgetId)); // path parameter if (accountId != null) @@ -1419,13 +1419,13 @@ public async System.Threading.Tasks.Task GetTransact String[] @accepts = new String[] { "application/json" }; - + foreach (var contentType in @contentTypes) requestOptions.HeaderParameters.Add("Content-Type", contentType); - + foreach (var accept in @accepts) requestOptions.HeaderParameters.Add("Accept", accept); - + if (budgetId != null) requestOptions.PathParameters.Add("budget_id", YNAB.SDK.Client.ClientUtils.ParameterToString(budgetId)); // path parameter if (categoryId != null) @@ -1633,13 +1633,13 @@ public async System.Threading.Tasks.Task GetTransact String[] @accepts = new String[] { "application/json" }; - + foreach (var contentType in @contentTypes) requestOptions.HeaderParameters.Add("Content-Type", contentType); - + foreach (var accept in @accepts) requestOptions.HeaderParameters.Add("Accept", accept); - + if (budgetId != null) requestOptions.PathParameters.Add("budget_id", YNAB.SDK.Client.ClientUtils.ParameterToString(budgetId)); // path parameter if (payeeId != null) @@ -1818,13 +1818,13 @@ public async System.Threading.Tasks.Task UpdateTransactionA String[] @accepts = new String[] { "application/json" }; - + foreach (var contentType in @contentTypes) requestOptions.HeaderParameters.Add("Content-Type", contentType); - + foreach (var accept in @accepts) requestOptions.HeaderParameters.Add("Accept", accept); - + if (budgetId != null) requestOptions.PathParameters.Add("budget_id", YNAB.SDK.Client.ClientUtils.ParameterToString(budgetId)); // path parameter if (transactionId != null) @@ -1960,13 +1960,13 @@ public async System.Threading.Tasks.Task UpdateTransac String[] @accepts = new String[] { "application/json" }; - + foreach (var contentType in @contentTypes) requestOptions.HeaderParameters.Add("Content-Type", contentType); - + foreach (var accept in @accepts) requestOptions.HeaderParameters.Add("Accept", accept); - + if (budgetId != null) requestOptions.PathParameters.Add("budget_id", YNAB.SDK.Client.ClientUtils.ParameterToString(budgetId)); // path parameter requestOptions.Data = data; diff --git a/YNAB.SDK/examples/CreateTransaction.cs b/YNAB.SDK/examples/CreateTransaction.cs index a3fd881..32baf95 100644 --- a/YNAB.SDK/examples/CreateTransaction.cs +++ b/YNAB.SDK/examples/CreateTransaction.cs @@ -1,21 +1,41 @@ using System; +using System.Linq; using System.Threading.Tasks; +using YNAB.SDK.Model; namespace YNAB.SDK.Examples { public class CreateTransaction { private readonly API _ynabApi; + private readonly SaveTransaction _transaction; + private readonly BudgetDetail _testBudget; public CreateTransaction(API api) { _ynabApi = api; + _testBudget = _ynabApi.Budgets.GetBudgetById("14235236-8085-4cf6-9fa6-92c34ed44b0c").Data.Budget; + _transaction = new SaveTransaction + { + AccountId = _testBudget.Accounts.First().Id, + Amount = 100L, + Date = DateTime.Now, + PayeeId = _testBudget.Payees.First().Id, + PayeeName = _testBudget.Payees.First().Name, + CategoryId = _testBudget.Categories.First().Id, + Memo = "Test Transaction", + Approved = true, + Cleared = SaveTransaction.ClearedEnum.Cleared, + FlagColor = SaveTransaction.FlagColorEnum.Red + }; } - private async Task ExecuteAsync() { - throw new NotImplementedException(); + public async Task ExecuteAsync() { + _transaction.Memo = "ASYNC TEST"; + var result = await _ynabApi.Transactions.CreateTransactionAsync(_testBudget.Id.ToString(), new Model.SaveTransactionsWrapper(_transaction)); } - private void Execute() { - throw new NotImplementedException(); + public void Execute() { + _transaction.Memo = "TEST"; + var result = _ynabApi.Transactions.CreateTransaction(_testBudget.Id.ToString(), new Model.SaveTransactionsWrapper(_transaction)); } } }