Open NickLydon opened 3 years ago
Hey Nick,
I was digging through the Orleans code, and I found some inspiration for this here, try this:
[Fact]
public async Task SaysHelloCorrectly()
{
var builder = new TestClusterBuilder();
builder.Options.ServiceId = Guid.NewGuid().ToString();
var cluster = builder.Build();
cluster.Deploy();
var hello = cluster.GrainFactory.GetGrain<IHelloGrain>(Guid.NewGuid());
var greeting = await hello.SayHello();
cluster.StopAllSilos();
Assert.Equal("Hello, World", greeting);
}
Looks like this is also part of the example later on, but yeah it should be up there with the SaysHelloCorrectly
test too so you can actually compile and run.
@QueenCitySmitty @ReubenBond Great, but now maybe we should remove the page https://dotnet.github.io/orleans/docs/implementation/testing.html since it contains exactly the same code but without those modifications. It seems to be a full duplicate.
@Expecho Good callout, I'll put out a PR in the docs
@Expecho here it is, take a quick look. Thanks!
@QueenCitySmitty looks fine to me, thanks!
@QueenCitySmitty found another issue with the docs, see https://github.com/dotnet/orleans-docs/pull/47
From https://github.com/dotnet/orleans-docs/blob/master/src/docs/implementation/testing.md/#L1
TestCluster
doesn't have a parameterless constructor, and it's not obvious what's needed to get it going. Should its usage be completely replaced byTestClusterBuilder
?