Esempio n. 1
0
        public void ResetTest()
        {
            FileMARC target = new FileMARC();

            target.ImportMARC("record.mrc");
            target.ImportMARC("record2.mrc");
            target.MoveNext();
            target.MoveNext();
            target.MoveNext();
            target.Reset();
            target.MoveNext();
            bool expected = true;
            bool actual   = target.MoveNext();

            Assert.AreEqual(expected, actual);
        }
Esempio n. 2
0
        public void CurrentTest()
        {
            FileMARC target = new FileMARC();

            target.ImportMARC("record.mrc");
            //This string is taken as a copy and paste from record.mrc in the Test Records directory.
            string expected = "01754cam a2200397 a 45000010009000000050017000090080041000269060045000679250044001129550187001560100017003430200034003600200037003940350023004310350020004540370060004740400049005340420009005830500024005920820014006161000018006302450070006482600038007183000029007565860037007855200280008226500038011026500034011406500031011746500031012056500029012366500025012656500022012906500022013126500022013341460273320110216094643.0061020s2007    nyua   c      000 f eng    a7bcbccorignewd1eecipf20gy-gencatlg0 aacquireb2 shelf copiesxpolicy default  alb18 2006-10-20ilb18 2006-10-20elb18 2006-10-20 to CIPaps04 2007-05-17 1 copy rec'd., to CIP ver.fld11 2007-07-02 Z-CipVergld11 2007-07-02 to BCCDalf27 2007-07-11 cp. 2 to BCCD  a  2006031847  a0810993139 (paper over board)  a9780810993136 (paper over board)  a(OCoLC)ocm74029165  a(OCoLC)74029165  bJunior Library Guildnhttp://www.juniorlibraryguild.com  aDLCcDLCdBAKERdBTCTAdTEFdYDXCPdEHHdDLC  alcac00aPZ7.K6232bDia 200700a[Fic]2221 aKinney, Jeff.10aDiary of a wimpy kid :bGreg Heffley's journal /cby Jeff Kinney.  aNew York :bAmulet Books,cc2007.  a217 p. :bill. ;c22 cm.8 aA Junior Library Guild selection  aGreg records his sixth grade experiences in a middle school where he and his best friend, Rowley, undersized weaklings amid boys who need to shave twice daily, hope just to survive, but when Rowley grows more popular, Greg must take drastic measures to save their friendship. 0aMiddle schoolsvJuvenile fiction. 0aFriendshipvJuvenile fiction. 0aSchoolsvJuvenile fiction. 0aDiariesvJuvenile fiction. 1aMiddle schoolsvFiction. 1aFriendshipvFiction. 1aSchoolsvFiction. 1aDiariesvFiction. 1aHumorous stories.";

            target.MoveNext();
            object current = target.Current;
            string actual  = ((Record)current).ToRaw();

            Assert.AreEqual(expected, actual);
            target.Reset();
            current = target.Current;             //This will throw an exception
        }