Skip to content

Commit

Permalink
Subaccount has workspace property instead of just workspaceKey
Browse files Browse the repository at this point in the history
  • Loading branch information
mroloux committed Oct 16, 2019
1 parent 2212aee commit f6e05f0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
4 changes: 3 additions & 1 deletion SeatsioDotNet.Test/Subaccounts/RetrieveSubaccountTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
4 changes: 2 additions & 2 deletions SeatsioDotNet.Test/WorkspaceKeyAuthenticationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
6 changes: 4 additions & 2 deletions SeatsioDotNet/Subaccounts/Subaccount.cs
Original file line number Diff line number Diff line change
@@ -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; }
}
}
8 changes: 8 additions & 0 deletions SeatsioDotNet/Workspaces/Workspace.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace SeatsioDotNet.Workspaces
{
public class Workspace
{
public long Id { get; set; }
public string Key { get; set; }
}
}

0 comments on commit f6e05f0

Please sign in to comment.