コード例 #1
0
        public void DeleteOneRecord_WithTwoNote()
        {
            NoteBookService noteBook = NoteBookService.GetInstance();

            noteBook.DeleteRecord(2);
            string actual   = noteBook.ToString();
            string expected = $"#1, first was written by PashaFast in {DateTime.Now}. Add has next text blblabla; ";

            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void CreateRecord_WithOneNote()
        {
            NoteBookService noteBook = NoteBookService.GetInstance();

            noteBook.CreateRecord("first", "blblabla", "PashaFast");
            string actual    = noteBook.ToString();
            string expected1 = $"#1, first, {DateTime.Now}, blblabla; ";
            string expected  = $"#1, first was written by PashaFast in {DateTime.Now}. Add has next text blblabla; ";

            Assert.AreEqual(expected, actual);
        }
コード例 #3
0
        public void EditRecord_WithTwoNote()
        {
            NoteBookService noteBook = NoteBookService.GetInstance();

            noteBook.EditRecord(2, "fourth", "la-la-la", "AnzhelikaKravchuk");
            string actual   = noteBook.ToString();
            string expected = $"#1, first was written by PashaFast in {DateTime.Now}. Add has next text blblabla; " +
                              $"#2, fourth was written by AnzhelikaKravchuk in {DateTime.Now}. Add has next text la-la-la; ";

            Assert.AreEqual(expected, actual);
        }
コード例 #4
0
        public void CreateRecord_WithTwoNote()
        {
            NoteBookService noteBook = NoteBookService.GetInstance();

            noteBook.DeleteRecord(1);
            noteBook.CreateRecord("first", "blblabla", "PashaFast");
            noteBook.CreateRecord("second", "some content", "John Skeet");
            string actual   = noteBook.ToString();
            string expected = $"#1, first was written by PashaFast in {DateTime.Now}. Add has next text blblabla; " +
                              $"#2, second was written by John Skeet in {DateTime.Now}. Add has next text some content; ";

            Assert.AreEqual(expected, actual);
        }