-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add TGrainState type constraints to document necessary system constraints - Resolves #1906 #1923
Changes from all commits
d4e20fe
874c9f3
69e272f
b52fa3d
86501fe
117e405
ba21211
0e865d5
a0f1c25
36974bc
39b3d73
8f878de
961ecdd
34a9f3f
fd29e2e
19d672b
538167f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,40 +4,23 @@ | |
|
||
namespace UnitTests.Grains | ||
{ | ||
public class ValueTypeTestGrainState | ||
{ | ||
public ValueTypeTestData StateData { get; set; } | ||
} | ||
|
||
[Orleans.Providers.StorageProvider(ProviderName = "MemoryStore")] | ||
public class ValueTypeTestGrain : Grain<ValueTypeTestGrainState>, IValueTypeTestGrain | ||
public class ValueTypeTestGrain : Grain<ValueTypeTestData>, IValueTypeTestGrain | ||
{ | ||
public ValueTypeTestGrain() | ||
{ | ||
State.StateData = new ValueTypeTestData(7); | ||
} | ||
|
||
public Task SetState(ValueTypeTestData d) | ||
{ | ||
State.StateData = d; | ||
return TaskDone.Done; | ||
} | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wow, I see that we had dead code there for testing structs. If possible, instead of using an int64 as you are now, I would use Also, you probably don't need to move the implementation to TesterInternal. From what I understand, these tests are not using anything that requires access to the internals (not public exposed) members of Orleans, correct? |
||
public Task<CampaignEnemyTestType> GetEnemyType() | ||
public async Task<ValueTypeTestData> GetStateData() | ||
{ | ||
return Task.FromResult(CampaignEnemyTestType.Enemy2); | ||
await ReadStateAsync(); | ||
return State; | ||
} | ||
|
||
public Task<ValueTypeTestData> GetStateData() | ||
{ | ||
return Task.FromResult(State.StateData); | ||
} | ||
|
||
|
||
public Task SetStateData(ValueTypeTestData d) | ||
{ | ||
State.StateData = d; | ||
return TaskDone.Done; | ||
State = d; | ||
return WriteStateAsync(); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class
ValueTypeTestGrainState
is no longer needed. This used to inherit from GrainState, but that's no longer needed, and for some reason that inheritance was removed at the same time the file was moved (hmmm), so that's why diffing it was hard and the change was missed.