From f6e05f0d1baeb45719450805b65c3d22b0932fc0 Mon Sep 17 00:00:00 2001 From: mroloux Date: Wed, 16 Oct 2019 20:29:30 +0200 Subject: [PATCH] Subaccount has workspace property instead of just workspaceKey --- SeatsioDotNet.Test/Subaccounts/RetrieveSubaccountTest.cs | 4 +++- SeatsioDotNet.Test/WorkspaceKeyAuthenticationTest.cs | 4 ++-- SeatsioDotNet/Subaccounts/Subaccount.cs | 6 ++++-- SeatsioDotNet/Workspaces/Workspace.cs | 8 ++++++++ 4 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 SeatsioDotNet/Workspaces/Workspace.cs diff --git a/SeatsioDotNet.Test/Subaccounts/RetrieveSubaccountTest.cs b/SeatsioDotNet.Test/Subaccounts/RetrieveSubaccountTest.cs index 96b6c52..070132d 100644 --- a/SeatsioDotNet.Test/Subaccounts/RetrieveSubaccountTest.cs +++ b/SeatsioDotNet.Test/Subaccounts/RetrieveSubaccountTest.cs @@ -17,7 +17,9 @@ public void Test() Assert.Equal(subaccount.PublicKey, retrievedSubaccount.PublicKey); Assert.Equal("joske", retrievedSubaccount.Name); Assert.True(retrievedSubaccount.Active); - Assert.NotNull(retrievedSubaccount.workspaceKey); + Assert.NotNull(retrievedSubaccount.workspace); + Assert.NotEqual(0, retrievedSubaccount.workspace.Id); + Assert.NotNull(retrievedSubaccount.workspace.Key); } } } \ No newline at end of file diff --git a/SeatsioDotNet.Test/WorkspaceKeyAuthenticationTest.cs b/SeatsioDotNet.Test/WorkspaceKeyAuthenticationTest.cs index 02cb08e..4649674 100644 --- a/SeatsioDotNet.Test/WorkspaceKeyAuthenticationTest.cs +++ b/SeatsioDotNet.Test/WorkspaceKeyAuthenticationTest.cs @@ -9,10 +9,10 @@ public void Test() { var subaccount = Client.Subaccounts.Create(); - var subaccountClient = CreateSeatsioClient(User.SecretKey, subaccount.workspaceKey); + var subaccountClient = CreateSeatsioClient(User.SecretKey, subaccount.workspace.Key); var holdToken = subaccountClient.HoldTokens.Create(); - Assert.Equal(subaccount.workspaceKey, holdToken.workspaceKey); + Assert.Equal(subaccount.workspace.Key, holdToken.workspaceKey); } } } \ No newline at end of file diff --git a/SeatsioDotNet/Subaccounts/Subaccount.cs b/SeatsioDotNet/Subaccounts/Subaccount.cs index 5173acb..fbb6327 100644 --- a/SeatsioDotNet/Subaccounts/Subaccount.cs +++ b/SeatsioDotNet/Subaccounts/Subaccount.cs @@ -1,14 +1,16 @@ -namespace SeatsioDotNet.Subaccounts +using SeatsioDotNet.Workspaces; + +namespace SeatsioDotNet.Subaccounts { public class Subaccount { public long Id { get; set; } - public string workspaceKey { get; set; } public string SecretKey { get; set; } public string DesignerKey { get; set; } public string PublicKey { get; set; } public string Name { get; set; } public string Email { get; set; } public bool Active { get; set; } + public Workspace workspace { get; set; } } } \ No newline at end of file diff --git a/SeatsioDotNet/Workspaces/Workspace.cs b/SeatsioDotNet/Workspaces/Workspace.cs new file mode 100644 index 0000000..1095b69 --- /dev/null +++ b/SeatsioDotNet/Workspaces/Workspace.cs @@ -0,0 +1,8 @@ +namespace SeatsioDotNet.Workspaces +{ + public class Workspace + { + public long Id { get; set; } + public string Key { get; set; } + } +} \ No newline at end of file