Exemple #1
0
        public async Task OpenFileTest()
        {
            var passageIO   = new PassageIO();
            var passageInfo = new UserDictionary.Passage();
            var passage     = new ExReaderPlus.Manage.PassageManager.Passage();

            passageInfo.Id  = 2;
            passage.Content = "Hello world";

            Assert.AreEqual(true, await passageIO.SavaPassage(passage, passageInfo));
        }
Exemple #2
0
        public void ifExistTest()
        {
            var passage0 = new ExReaderPlus.Manage.PassageManager.Passage
            {
                Content = "Mr. Johnson had never been up in an aerophane before and he " +
                          "had read a lot about air accidents, so one day when a friend offered to take him for a ride in his own small phane, " +
                          "Mr. Johnson was very worried about accepting. Finally, however, his friend persuaded him that it was very safe, and Mr. Johnson boarded the plane.",
                HeadName = "test0"
            };

            Assert.AreEqual("test0", PassageManage.ifExsist(passage0).Name);
        }
Exemple #3
0
        public void DeleteDeletePassageInfoAndPassageTest()
        {
            var passage0 = new ExReaderPlus.Manage.PassageManager.Passage
            {
                Content = "Mr. Johnson had never been up in an aerophane before and he " +
                          "had read a lot about air accidents, so one day when a friend offered to take him for a ride in his own small phane, " +
                          "Mr. Johnson was very worried about accepting. Finally, however, his friend persuaded him that it was very safe, and Mr. Johnson boarded the plane.",
                HeadName = "test3"
            };

            PassageManage.SavaPassageInfoAndPassage(passage0);

            Assert.AreEqual(1, PassageManage.DeletePassageInfoAndPassage(new UserDictionary.Passage
            {
                Id = 4
            }));
        }
Exemple #4
0
        public async Task SaveFileTask()
        {
            var passageIO   = new PassageIO();
            var passageInfo = new UserDictionary.Passage();

            passageInfo.Id = 1;


            var passage = new ExReaderPlus.Manage.PassageManager.Passage();

            passage.Content = "Hello world";
            await passageIO.SavaPassage(passage, passageInfo);

            var passage1 = new ExReaderPlus.Manage.PassageManager.Passage();

            passage1 = await passageIO.ReadPassage(passageInfo);

            Assert.AreEqual(passage1.Content, "Hello world");
        }
Exemple #5
0
        public void SavaPassageInfoAndPassageTest()
        {
            var passage0 = new ExReaderPlus.Manage.PassageManager.Passage
            {
                Content = "Mr. Johnson had never been up in an aerophane before and he " +
                          "had read a lot about air accidents, so one day when a friend offered to take him for a ride in his own small phane, " +
                          "Mr. Johnson was very worried about accepting. Finally, however, his friend persuaded him that it was very safe, and Mr. Johnson boarded the plane.",
                HeadName = "test0"
            };

            // var passage1 = new ExReaderPlus.Manage.PassageManager.Passage
            // {
            //     Content = "First Flight Mr. Johnson had never been up in an aerophane before and he had read a lot about air accidents",
            //     HeadName="test1"

            // };
            PassageManage.SavaPassageInfoAndPassage(passage0);
            //PassageManage.SavaPassageInfoAndPassage(passage1);
        }