public void AdhocUnionOneOfTwoCanSerializeAndDeserialize()
		{
			var value = Union.FromTypes<sbyte, byte>().Create((sbyte)64);

			SerializationUtility
				.CloneViaSerialization(value)
				.Value()
				.Do(_ => { }, _ => { })
				.Should()
				.BeEquivalentTo(value);
		}
		public void AdhocUnionFourOfFiveCanSerializeAndDeserialize()
		{
			var value = Union.FromTypes<sbyte, byte, short, ushort, int>().Create((ushort)64);

			SerializationUtility
				.CloneViaSerialization(value)
				.Value()
				.Do(_ => { }, _ => { }, _ => { }, _ => { }, _ => { })
				.Should()
				.BeEquivalentTo(value);
		}
Exemple #3
0
        public void UnionDefinitionOneOfFourCanSerializeAndDeserialize()
        {
            var value = Union.FromDefinition <FourUnionDefinition>().Create((sbyte)64);

            SerializationUtility
            .CloneViaSerialization(value)
            .Value()
            .Do(_ => { }, _ => { }, _ => { }, _ => { })
            .Should()
            .BeEquivalentTo(value);
        }
Exemple #4
0
        public void UnionDefinitionThreeOfThreeCanSerializeAndDeserialize()
        {
            var value = Union.FromDefinition <ThreeUnionDefinition>().Create((short)64);

            SerializationUtility
            .CloneViaSerialization(value)
            .Value()
            .Do(_ => { }, _ => { }, _ => { })
            .Should()
            .BeEquivalentTo(value);
        }
Exemple #5
0
        public void UnionDefinitionEightOfEightCanSerializeAndDeserialize()
        {
            var value = Union.FromDefinition <EightUnionDefinition>().Create((ulong)64);

            SerializationUtility
            .CloneViaSerialization(value)
            .Value()
            .Do(_ => { }, _ => { }, _ => { }, _ => { }, _ => { }, _ => { }, _ => { }, _ => { })
            .Should()
            .BeEquivalentTo(value);
        }
Exemple #6
0
        public void UnionDefinitionSixOfSevenCanSerializeAndDeserialize()
        {
            var value = Union.FromDefinition <SevenUnionDefinition>().Create((uint)64);

            SerializationUtility
            .CloneViaSerialization(value)
            .Value()
            .Do(_ => { }, _ => { }, _ => { }, _ => { }, _ => { }, _ => { }, _ => { })
            .Should()
            .BeEquivalentTo(value);
        }
Exemple #7
0
        public void AdhocUnionEightOfEightCanSerializeAndDeserialize()
        {
            var value = Union.FromTypes <sbyte, byte, short, ushort, int, uint, long, ulong>().Create((ulong)64);

            SerializationUtility
            .CloneViaSerialization(value)
            .Value()
            .Do(_ => { }, _ => { }, _ => { }, _ => { }, _ => { }, _ => { }, _ => { }, _ => { })
            .Should()
            .BeEquivalentTo(value);
        }