public void TwoKeysTiposMios() { TwoKeys <IdUnico, byte[]> pair = new TwoKeys <IdUnico, byte[]>(new IdUnico(), Serializar.GetBytes("Gabriel")); ElementoBinario serializador = ElementoBinario.GetSerializador(pair.GetType()); byte[] data = serializador.GetBytes(pair); TwoKeys <IdUnico, byte[]> pairDeserializada = (TwoKeys <IdUnico, byte[]>)serializador.GetObject(data); Assert.IsTrue(pair.Key1.GetId().ArrayEqual(pairDeserializada.Key1.GetId()) && pair.Key2.ArrayEqual(pairDeserializada.Key2)); }
public void KeyValuePairTiposAnidados() { TwoKeys <IdUnico, TwoKeys <long, string> > pair = new TwoKeys <IdUnico, TwoKeys <long, string> >(new IdUnico(), new TwoKeys <long, string>(125, "Gabriel")); ElementoBinario serializador = ElementoBinario.GetSerializador(pair.GetType()); byte[] data = serializador.GetBytes(pair); TwoKeys <IdUnico, TwoKeys <long, string> > pairDeserializada = (TwoKeys <IdUnico, TwoKeys <long, string> >)serializador.GetObject(data); Assert.IsTrue(pair.Key1.GetId().ArrayEqual(pairDeserializada.Key1.GetId()) && pair.Key2.Key1.Equals(pairDeserializada.Key2.Key1) && pair.Key2.Key2.Equals(pairDeserializada.Key2.Key2)); }
public void TwoKeysTiposBasicos() { TwoKeys <long, string> pair = new TwoKeys <long, string>(125, "Gabriel"); ElementoBinario serializador = ElementoBinario.GetSerializador(pair.GetType()); byte[] data = serializador.GetBytes(pair); TwoKeys <long, string> pairDeserializada = (TwoKeys <long, string>)serializador.GetObject(data); Assert.IsTrue(pair.Key1.Equals(pairDeserializada.Key1) && pair.Key2.Equals(pairDeserializada.Key2)); }
public static Context <byte> Encrypt(Context <byte> context, byte[] password, LevelEncrypt level = LevelEncrypt.Normal, StopProcess stopProcess = null) { TwoKeys <int, int> minMax = GetMinMax(context.Input); return(CommonDisimulatMethod.Encrypt(context, password, minMax.Key1, minMax.Key2, level, stopProcess)); }
protected override IList IGetPartsObject(object obj) { TwoKeys <TKey1, TKey2> keys = (TwoKeys <TKey1, TKey2>)obj; return(base.IGetPartsObject(new KeyValuePair <TKey1, TKey2>(keys.Key1, keys.Key2))); }