public async Task MultifacetFactory() { IMultifacetFactoryTestGrain factory = GrainClient.GrainFactory.GetGrain <IMultifacetFactoryTestGrain>(GetRandomGrainId()); IMultifacetTestGrain grain = GrainClient.GrainFactory.GetGrain <IMultifacetTestGrain>(GetRandomGrainId()); IMultifacetWriter writer = await factory.GetWriter(grain /*"MultifacetFactory"*/); IMultifacetReader reader = await factory.GetReader(grain /*"MultifacetFactory"*/); writer.SetValue(5).Wait(); int v = reader.GetValue().Result; Assert.Equal(5, v); }
public async Task Multifacet_InterfacesAsArguments() { IMultifacetFactoryTestGrain factory = GrainClient.GrainFactory.GetGrain <IMultifacetFactoryTestGrain>(GetRandomGrainId()); IMultifacetTestGrain grain = GrainClient.GrainFactory.GetGrain <IMultifacetTestGrain>(GetRandomGrainId()); factory.SetReader(grain).Wait(); factory.SetWriter(grain).Wait(); IMultifacetWriter writer = await factory.GetWriter(); IMultifacetReader reader = await factory.GetReader(); writer.SetValue(10).Wait(); int v = reader.GetValue().Result; Assert.Equal(10, v); }