public void SerializationTests_RecursiveSerialization() { TestTypeA input = new TestTypeA(); input.Collection = new HashSet <TestTypeA>(); input.Collection.Add(input); TestTypeA output1 = Orleans.TestingHost.Utils.TestingUtils.RoundTripDotNetSerializer(input, this.fixture.GrainFactory, this.fixture.SerializationManager); TestTypeA output2 = this.fixture.SerializationManager.RoundTripSerializationForTesting(input); }
public void SerializationTests_RecursiveSerialization() { TestTypeA input = new TestTypeA(); input.Collection = new HashSet <TestTypeA>(); input.Collection.Add(input); TestTypeA output1 = TestingUtils.RoundTripDotNetSerializer(input); TestTypeA output2 = SerializationManager.RoundTripSerializationForTesting(input); }
public void GivenValidTemplate_WhenMergeValue_ThenCorrectProcessorInvoked_Test() { var p1 = Substitute.For <IFhirValueProcessor <string, string> >(); p1.SupportedValueType.Returns(typeof(TestTypeA)); var p2 = Substitute.For <IFhirValueProcessor <string, string> >(); p2.SupportedValueType.Returns(typeof(TestTypeB)); var processor = new TestCollectionFhirValueProcessor(p1, p2); var vt1 = new TestTypeA(); var vt2 = new TestTypeB(); processor.MergeValue(vt1, "e", "a"); p1.Received(1).MergeValue(vt1, "e", "a"); p2.DidNotReceiveWithAnyArgs().MergeValue(null, null, null); p1.ClearReceivedCalls(); processor.MergeValue(vt2, "e", "b"); p2.Received(1).MergeValue(vt2, "e", "b"); p1.DidNotReceiveWithAnyArgs().MergeValue(null, null, null); }
public static void Serializer(object untypedInput, ISerializationContext context, Type expected) { TestTypeA input = (TestTypeA)untypedInput; SerializationManager.SerializeInner(input.Collection, context, typeof(ICollection <TestTypeA>)); }
public static object DeepCopier(object original) { TestTypeA input = ((TestTypeA)(original)); TestTypeA result = new TestTypeA(); Orleans.Serialization.SerializationContext.Current.RecordObject(original, result); result.Collection = ((System.Collections.Generic.ICollection<TestTypeA>)(Orleans.Serialization.SerializationManager.DeepCopyInner(input.Collection))); return result; }
public void SerializationTests_RecursiveSerialization() { TestTypeA input = new TestTypeA(); input.Collection = new HashSet<TestTypeA>(); input.Collection.Add(input); TestTypeA output1 = TestingUtils.RoundTripDotNetSerializer(input); TestTypeA output2 = SerializationManager.RoundTripSerializationForTesting(input); }
public static object Deserializer(System.Type expected, global::Orleans.Serialization.BinaryTokenStreamReader stream) { TestTypeA result = new TestTypeA(); DeserializationContext.Current.RecordObject(result); result.Collection = ((System.Collections.Generic.ICollection<TestTypeA>)(Orleans.Serialization.SerializationManager.DeserializeInner(typeof(System.Collections.Generic.ICollection<TestTypeA>), stream))); return result; }
public static void Serializer(object untypedInput, Orleans.Serialization.BinaryTokenStreamWriter stream, System.Type expected) { TestTypeA input = ((TestTypeA)(untypedInput)); Orleans.Serialization.SerializationManager.SerializeInner(input.Collection, stream, typeof(System.Collections.Generic.ICollection <TestTypeA>)); }