コード例 #1
0
 public void TestRegisterDefaultImplementation1()
 {
     using (var silo = new InProcessSilo())
     {
         silo.RegisterDefaultImplementation <IVoidMethodNoParameters>(typeof(AbortsThread).AssemblyQualifiedName);
         var grain = silo.CreateGrain <IVoidMethodNoParameters>();
         grain.Should().BeOfType <AbortsThread>();
     }
 }
コード例 #2
0
        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");
            }
        }