예제 #1
0
        public void Polymorphic_FactoryMethods()
        {
            var grainFullName = typeof(PolymorphicTestGrain).FullName;
            IC  ICRef         = GrainClient.GrainFactory.GetGrain <IF>(GetRandomGrainId(), grainFullName); // FRef factory method returns a polymorphic reference to ICRef

            Assert.AreEqual("B2", ICRef.B2Method().Result);

            IA IARef = GrainClient.GrainFactory.GetGrain <ID>(GetRandomGrainId(), grainFullName); // DRef factory method returns a polymorphic reference to IARef

            Assert.AreEqual("A1", IARef.A1Method().Result);
        }