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); }
public void GetTupleFrom_StringRepresentingPair_DeserializesToInheritedObject() { var ser = new TupleSerializer <ObjectThatInheritsFromTuple>(); var tuple = ser.GetTupleFrom("EUR-EUR"); Assert.Equal(new ObjectThatInheritsFromTuple("EUR", "EUR"), tuple); }
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); }
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")); }
public void GetTupleFrom_TuplePairSerializerGetsTupleTriad_ThrowsException() { var ser = new TupleSerializer <Tuple <string, string> >(); Assert.Throws <InvalidOperationException>(() => ser.GetTupleFrom("EUR-EUR-EUR")); }