-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing properties with duplicate names (#68)
- Loading branch information
Showing
18 changed files
with
1,236 additions
and
716 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
test/Candid.Tests/Generators/Files/DuplicatePropertyNames.did
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
type Result = { | ||
a : nat64; | ||
_a : nat64; | ||
}; | ||
|
||
service : () -> { | ||
a : () -> (Result) query; | ||
} |
58 changes: 58 additions & 0 deletions
58
...apshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_False.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using EdjCase.ICP.Agent.Agents; | ||
using EdjCase.ICP.Candid.Models; | ||
using EdjCase.ICP.Candid; | ||
using Test; | ||
using EdjCase.ICP.Agent.Responses; | ||
|
||
namespace Test | ||
{ | ||
public class DuplicatePropertyNamesApiClient | ||
{ | ||
public IAgent Agent { get; } | ||
|
||
public Principal CanisterId { get; } | ||
|
||
public CandidConverter Converter { get; } | ||
|
||
public DuplicatePropertyNamesApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) | ||
{ | ||
this.Agent = agent; | ||
this.CanisterId = canisterId; | ||
this.Converter = converter; | ||
} | ||
|
||
public async System.Threading.Tasks.Task<Models.Result> A() | ||
{ | ||
CandidArg arg = CandidArg.FromCandid(); | ||
QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); | ||
CandidArg reply = response.ThrowOrGetReply(); | ||
return reply.ToObjects<Models.Result>(this.Converter); | ||
} | ||
} | ||
} | ||
|
||
Type File: 'Result' | ||
|
||
using EdjCase.ICP.Candid.Mapping; | ||
|
||
namespace Test.Models | ||
{ | ||
public class Result | ||
{ | ||
[CandidName("a")] | ||
public ulong A { get; set; } | ||
|
||
[CandidName("_a")] | ||
public ulong _A { get; set; } | ||
|
||
public Result(ulong a, ulong _a) | ||
{ | ||
this.A = a; | ||
this._A = _a; | ||
} | ||
|
||
public Result() | ||
{ | ||
} | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
...napshots__/DuplicatePropertyNames_NoFolders_False_Nullable_False_KeepCandidCase_True.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using EdjCase.ICP.Agent.Agents; | ||
using EdjCase.ICP.Candid.Models; | ||
using EdjCase.ICP.Candid; | ||
using Test; | ||
using EdjCase.ICP.Agent.Responses; | ||
|
||
namespace Test | ||
{ | ||
public class DuplicatePropertyNamesApiClient | ||
{ | ||
public IAgent Agent { get; } | ||
|
||
public Principal CanisterId { get; } | ||
|
||
public CandidConverter Converter { get; } | ||
|
||
public DuplicatePropertyNamesApiClient(IAgent agent, Principal canisterId, CandidConverter converter = default) | ||
{ | ||
this.Agent = agent; | ||
this.CanisterId = canisterId; | ||
this.Converter = converter; | ||
} | ||
|
||
public async System.Threading.Tasks.Task<Models.Result> a() | ||
{ | ||
CandidArg arg = CandidArg.FromCandid(); | ||
QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); | ||
CandidArg reply = response.ThrowOrGetReply(); | ||
return reply.ToObjects<Models.Result>(this.Converter); | ||
} | ||
} | ||
} | ||
|
||
Type File: 'Result' | ||
|
||
namespace Test.Models | ||
{ | ||
public class Result | ||
{ | ||
public ulong a { get; set; } | ||
|
||
public ulong _a { get; set; } | ||
|
||
public Result(ulong a, ulong _a) | ||
{ | ||
this.a = a; | ||
this._a = _a; | ||
} | ||
|
||
public Result() | ||
{ | ||
} | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
...napshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_False.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using EdjCase.ICP.Agent.Agents; | ||
using EdjCase.ICP.Candid.Models; | ||
using EdjCase.ICP.Candid; | ||
using Test; | ||
using EdjCase.ICP.Agent.Responses; | ||
|
||
namespace Test | ||
{ | ||
public class DuplicatePropertyNamesApiClient | ||
{ | ||
public IAgent Agent { get; } | ||
|
||
public Principal CanisterId { get; } | ||
|
||
public EdjCase.ICP.Candid.CandidConverter? Converter { get; } | ||
|
||
public DuplicatePropertyNamesApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) | ||
{ | ||
this.Agent = agent; | ||
this.CanisterId = canisterId; | ||
this.Converter = converter; | ||
} | ||
|
||
public async System.Threading.Tasks.Task<Models.Result> A() | ||
{ | ||
CandidArg arg = CandidArg.FromCandid(); | ||
QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); | ||
CandidArg reply = response.ThrowOrGetReply(); | ||
return reply.ToObjects<Models.Result>(this.Converter); | ||
} | ||
} | ||
} | ||
|
||
Type File: 'Result' | ||
|
||
using EdjCase.ICP.Candid.Mapping; | ||
|
||
namespace Test.Models | ||
{ | ||
public class Result | ||
{ | ||
[CandidName("a")] | ||
public ulong A { get; set; } | ||
|
||
[CandidName("_a")] | ||
public ulong _A { get; set; } | ||
|
||
public Result(ulong a, ulong _a) | ||
{ | ||
this.A = a; | ||
this._A = _a; | ||
} | ||
|
||
public Result() | ||
{ | ||
} | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
...snapshots__/DuplicatePropertyNames_NoFolders_False_Nullable_True_KeepCandidCase_True.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using EdjCase.ICP.Agent.Agents; | ||
using EdjCase.ICP.Candid.Models; | ||
using EdjCase.ICP.Candid; | ||
using Test; | ||
using EdjCase.ICP.Agent.Responses; | ||
|
||
namespace Test | ||
{ | ||
public class DuplicatePropertyNamesApiClient | ||
{ | ||
public IAgent Agent { get; } | ||
|
||
public Principal CanisterId { get; } | ||
|
||
public EdjCase.ICP.Candid.CandidConverter? Converter { get; } | ||
|
||
public DuplicatePropertyNamesApiClient(IAgent agent, Principal canisterId, CandidConverter? converter = default) | ||
{ | ||
this.Agent = agent; | ||
this.CanisterId = canisterId; | ||
this.Converter = converter; | ||
} | ||
|
||
public async System.Threading.Tasks.Task<Models.Result> a() | ||
{ | ||
CandidArg arg = CandidArg.FromCandid(); | ||
QueryResponse response = await this.Agent.QueryAsync(this.CanisterId, "a", arg); | ||
CandidArg reply = response.ThrowOrGetReply(); | ||
return reply.ToObjects<Models.Result>(this.Converter); | ||
} | ||
} | ||
} | ||
|
||
Type File: 'Result' | ||
|
||
namespace Test.Models | ||
{ | ||
public class Result | ||
{ | ||
public ulong a { get; set; } | ||
|
||
public ulong _a { get; set; } | ||
|
||
public Result(ulong a, ulong _a) | ||
{ | ||
this.a = a; | ||
this._a = _a; | ||
} | ||
|
||
public Result() | ||
{ | ||
} | ||
} | ||
} |
Oops, something went wrong.