コード例 #1
0
 public void A_Create()
 {
     a        = new Project.Data.Repository(db);
     unitTest = new Project.Domain.Journal();
     unitTest.JournalEntry = "Test 1";
     unitTest.Title        = "Test Title";
     a.CreateJournal(unitTest);
     Assert.Pass();
 }
コード例 #2
0
        public void B_Read_3()
        {
            a = new Project.Data.Repository(db);
            int jour = 0;

            foreach (var i in a.GetJournals())
            {
                jour = i.Id;
            }
            unitTest = a.GetJournalByTitle("Test Title");
            Assert.AreEqual(unitTest.Id, jour);
        }
コード例 #3
0
        public void B_Read_2()
        {
            a = new Project.Data.Repository(db);
            int jour = 0;

            foreach (var i in a.GetJournals())
            {
                jour = i.Id;
            }
            unitTest = a.GetJournalById(jour);
            Assert.AreEqual(unitTest.JournalEntry, "Test 1");
        }
コード例 #4
0
        public void C_Update()
        {
            a = new Project.Data.Repository(db);
            int jour = 0;

            foreach (var i in a.GetJournals())
            {
                jour = i.Id;
            }
            unitTest = a.GetJournalById(jour);
            unitTest.JournalEntry = "Test new entry";
            a.UpdateJournal(unitTest);
            unitTest = a.GetJournalById(jour);
            Assert.AreEqual(unitTest.JournalEntry, "Test new entry");
        }