public void GetTupleFrom_StringRepresentingTriad_ReturnsDeserializedTriad()
        {
            var ser = new TupleSerializer<Tuple<string, string, string>>();

            var tuple = ser.GetTupleFrom("EUR-EUR-EUR");

            Assert.Equal(new Tuple<string, string, string>("EUR", "EUR", "EUR"), tuple);
        }
        public void GetTupleFrom_StringRepresentingPair_DeserializesToInheritedObject()
        {
            var ser = new TupleSerializer<ObjectThatInheritsFromTuple>();

            var tuple = ser.GetTupleFrom("EUR-EUR");

            Assert.Equal(new ObjectThatInheritsFromTuple("EUR", "EUR"), tuple);
        }
Ejemplo n.º 3
0
        public void GetTupleFrom_StringRepresentingPair_DeserializesToInheritedObject()
        {
            var ser = new TupleSerializer <ObjectThatInheritsFromTuple>();

            var tuple = ser.GetTupleFrom("EUR-EUR");

            Assert.Equal(new ObjectThatInheritsFromTuple("EUR", "EUR"), tuple);
        }
Ejemplo n.º 4
0
        public void GetTupleFrom_StringRepresentingTriad_ReturnsDeserializedTriad()
        {
            var ser = new TupleSerializer <Tuple <string, string, string> >();

            var tuple = ser.GetTupleFrom("EUR-EUR-EUR");

            Assert.Equal(new Tuple <string, string, string>("EUR", "EUR", "EUR"), tuple);
        }
        public void GetTupleFrom_StringRepresentingTriadWithCustomDelimiter_ReturnsDeserializedTriad()
        {
            var ser = new TupleSerializer<Tuple<string, string, string>>()
                .SetDelimiter(":");

            var tuple = ser.GetTupleFrom("EUR:EUR:EUR");

            Assert.Equal(new Tuple<string, string, string>("EUR", "EUR", "EUR"), tuple);
        }
Ejemplo n.º 6
0
        public void GetTupleFrom_StringRepresentingTriadWithCustomDelimiter_ReturnsDeserializedTriad()
        {
            var ser = new TupleSerializer <Tuple <string, string, string> >()
                      .SetDelimiter(":");

            var tuple = ser.GetTupleFrom("EUR:EUR:EUR");

            Assert.Equal(new Tuple <string, string, string>("EUR", "EUR", "EUR"), tuple);
        }
 public void GetTupleFrom_TuplePairSerializerGetsTupleTriad_ThrowsException()
 {
     var ser = new TupleSerializer<Tuple<string, string>>();
     Assert.Throws<InvalidOperationException>(() => ser.GetTupleFrom("EUR-EUR-EUR"));
 }
Ejemplo n.º 8
0
        public void GetTupleFrom_TuplePairSerializerGetsTupleTriad_ThrowsException()
        {
            var ser = new TupleSerializer <Tuple <string, string> >();

            Assert.Throws <InvalidOperationException>(() => ser.GetTupleFrom("EUR-EUR-EUR"));
        }