class GrainB : Grain, IGrainB
{
public async override Task OnActivateAsync()
{
var grain = GrainFactory.GetGrain<IGrainA>(0);
await grain.Register(this.GetPrimaryKeyString());
await base.OnActivateAsync();
}
}
class GrainA : Grain, IGrainA
{
public Task Register(string grainKey);
public Task UnRegister(string grainKey);
}
there is two Grain named GrainA and GrainB. GrainB depends on GrainA. I saw the Orleans's sample and the TestGrainFactory can create a local grain which I can test. when Grain is simple, it can be tested easily. but in my problem, GrainB depends on GrainA, how can I complete the test?
Aucun commentaire:
Enregistrer un commentaire