Пример #1
0
        public void Entity_Property_FieldHash_ret_str()
        {
            // Prepara
            EntityHashDemo entity = new EntityHashDemo
            {
                Clave1 = "Key1",
                Clave2 = "Key2",
                Campo1 = "Field1",
                Campo2 = "Field2",
                Campo3 = "Field3"
            };

            // Ejecuta
            string propHash = entity.FieldHash;

            // Comprueba
            Assert.AreEqual("Hash", propHash);
        }
Пример #2
0
        public void Entity_Property_FieldsHashCode_ret_str()
        {
            // Prepara
            EntityHashDemo entity = new EntityHashDemo
            {
                Clave1 = "Key1",
                Clave2 = "Key2",
                Campo1 = "Field1",
                Campo2 = "Field2",
                Campo3 = "Field3",
                Hash   = "Dummy"
            };

            // Ejecuta
            string hcode = entity.FieldsHashCode;

            // Comprueba
            string        fields       = string.Concat("Key1", "Key2", "Field1", "Field2", "Field3");
            HashGenerator hg           = new HashGenerator();
            string        hashGenerado = hg.GetHashCode(fields);

            Assert.AreEqual(hashGenerado, hcode);
        }