Example #1
0
        public async Task RuntimeCodeGenNestedGenericTest()
        {
            const int Expected = 123985;
            var       grain    = GrainFactory.GetGrain <INestedGenericGrain>(Guid.NewGuid());

            var nestedGeneric = new NestedGeneric <int> {
                Payload = new NestedGeneric <int> .Nested {
                    Value = Expected
                }
            };
            var actual = await grain.Do(nestedGeneric);

            Assert.Equal(Expected, actual); // NestedGeneric<int>.Nested value should round-trip correctly.

            var nestedConstructedGeneric = new NestedConstructedGeneric
            {
                Payload = new NestedConstructedGeneric.Nested <int> {
                    Value = Expected
                }
            };

            actual = await grain.Do(nestedConstructedGeneric);

            Assert.Equal(Expected, actual); // NestedConstructedGeneric.Nested<int> value should round-trip correctly.
        }
Example #2
0
 public Task <int> Do(NestedGeneric <int> value)
 {
     return(Task.FromResult(value.Payload.Value));
 }