public void TestRegisterDefaultImplementation1() { using (var silo = new InProcessSilo()) { silo.RegisterDefaultImplementation <IVoidMethodNoParameters>(typeof(AbortsThread).AssemblyQualifiedName); var grain = silo.CreateGrain <IVoidMethodNoParameters>(); grain.Should().BeOfType <AbortsThread>(); } }
public void TestCreate() { var customTypeResolver = new CustomTypeResolver1(); using (var silo = new InProcessSilo(customTypeResolver)) { customTypeResolver.GetTypeCalled.Should().Be(0); var grain = silo.CreateGrain <IVoidMethodNoParameters>(typeof(AbortsThread).AssemblyQualifiedName); customTypeResolver.GetTypeCalled.Should().Be(1, "because the silo should've used the custom type resolver we've specified in the ctor"); } }