Exemplo n.º 1
0
        public void tGetNoteList()
        {
            int ScrId = 1234;

            int RecordHandle = 2345;

            this.ToolKit.GetSCRRecordHandleReturn = RecordHandle;
            int NoteHandle = 3456;

            this.ToolKit.GetNoteHandleReturn = NoteHandle;
            List <Stubs.Note> NoteList;

            NoteList = new List <Test.Tracker.Stubs.Note>();
            this.ToolKit.NoteList = NoteList;
            Stubs.Note FirstNote  = new Stubs.Note("First", "Body", DateTime.Now.ToString(), "me");
            Stubs.Note SecondNote = new Stubs.Note("Second", "Text", DateTime.Now.ToString(), "you");
            this.ToolKit.NoteList.Add(FirstNote);
            this.ToolKit.NoteList.Add(SecondNote);

            StringCollection ConcatenatedNoteList;

            ConcatenatedNoteList = this.TrackerServer.GetNoteList(ScrId);

            string FirstConcatenatedNote;
            string SecondConcatenatedNote;

            FirstConcatenatedNote  = string.Format("{0} ({1}) {2}, {3}", NoteList[0].Title, NoteList[0].Author, NoteList[0].CreationTime, NoteList[0].Text);
            SecondConcatenatedNote = string.Format("{0} ({1}) {2}, {3}", NoteList[1].Title, NoteList[1].Author, NoteList[1].CreationTime, NoteList[1].Text);

            Assert.AreEqual(FirstConcatenatedNote, ConcatenatedNoteList[0]);
            Assert.AreEqual(SecondConcatenatedNote, ConcatenatedNoteList[1]);

            this.ToolKit.CheckGetSCRRecordHandle(ScrId);
            this.ToolKit.CheckGetNoteHandle(RecordHandle);
            this.ToolKit.CheckInitalizeNoteList(NoteHandle);
            this.ToolKit.CheckGetNextNote(NoteHandle);
            this.ToolKit.CheckGetNoteTitle(NoteHandle);
            this.ToolKit.CheckGetNoteText(NoteHandle);
            this.ToolKit.CheckGetNoteAuthor(NoteHandle);
            this.ToolKit.CheckGetNoteCreateTime(NoteHandle);
            this.ToolKit.CheckReleaseNoteHandle(NoteHandle);
            this.ToolKit.CheckReleaseRecordHandle(RecordHandle);
        }
Exemplo n.º 2
0
        public void tGetNoteList()
        {
            int ScrId = 1234;

            int RecordHandle = 2345;
            this.ToolKit.GetSCRRecordHandleReturn = RecordHandle;
            int NoteHandle = 3456;
            this.ToolKit.GetNoteHandleReturn = NoteHandle;
            List<Stubs.Note> NoteList;
            NoteList = new List<Test.Tracker.Stubs.Note>();
            this.ToolKit.NoteList = NoteList;
            Stubs.Note FirstNote = new Stubs.Note("First", "Body", DateTime.Now.ToString(), "me");
            Stubs.Note SecondNote = new Stubs.Note("Second", "Text", DateTime.Now.ToString(), "you");
            this.ToolKit.NoteList.Add(FirstNote);
            this.ToolKit.NoteList.Add(SecondNote);

            StringCollection ConcatenatedNoteList;
            ConcatenatedNoteList = this.TrackerServer.GetNoteList(ScrId);

            string FirstConcatenatedNote;
            string SecondConcatenatedNote;

            FirstConcatenatedNote = string.Format("{0} ({1}) {2}, {3}", NoteList[0].Title, NoteList[0].Author, NoteList[0].CreationTime, NoteList[0].Text);
            SecondConcatenatedNote = string.Format("{0} ({1}) {2}, {3}", NoteList[1].Title, NoteList[1].Author, NoteList[1].CreationTime, NoteList[1].Text);

            Assert.AreEqual(FirstConcatenatedNote, ConcatenatedNoteList[0]);
            Assert.AreEqual(SecondConcatenatedNote, ConcatenatedNoteList[1]);

            this.ToolKit.CheckGetSCRRecordHandle(ScrId);
            this.ToolKit.CheckGetNoteHandle(RecordHandle);
            this.ToolKit.CheckInitalizeNoteList(NoteHandle);
            this.ToolKit.CheckGetNextNote(NoteHandle);
            this.ToolKit.CheckGetNoteTitle(NoteHandle);
            this.ToolKit.CheckGetNoteText(NoteHandle);
            this.ToolKit.CheckGetNoteAuthor(NoteHandle);
            this.ToolKit.CheckGetNoteCreateTime(NoteHandle);
            this.ToolKit.CheckReleaseNoteHandle(NoteHandle);
            this.ToolKit.CheckReleaseRecordHandle(RecordHandle);
        }