Ejemplo n.º 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>();
     }
 }
Ejemplo n.º 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");
            }
        }