Beispiel #1
0
        public void Clone()
        {
            Fingerprint fp1 = new Fingerprint();

            fp1.AsBitmap = Settings.SomeFingerprint;
            fp1.Finger   = Finger.RightThumb;
            AfisEngine afis = new AfisEngine();

            afis.Extract(new Person(fp1));
            Assert.IsNotNull(fp1.Template);

            Fingerprint fp2 = fp1.Clone();

            Assert.AreEqual(fp1.Image, fp2.Image);
            Assert.AreEqual(Finger.RightThumb, fp2.Finger);
            Assert.AreEqual(fp1.Template, fp2.Template);

            Fingerprint fp3 = new Fingerprint().Clone();

            Assert.IsNull(fp3.Image);
            Assert.AreEqual(Finger.Any, fp3.Finger);
            Assert.IsNull(fp3.Template);

            Fingerprint fp4 = (fp2 as ICloneable).Clone() as Fingerprint;

            Assert.AreEqual(fp1.Image, fp4.Image);
            Assert.AreEqual(Finger.RightThumb, fp4.Finger);
            Assert.AreEqual(fp1.Template, fp4.Template);
        }