示例#1
0
 public FormNotes(ClassNotes notes)
 {
     InitializeComponent();
     Notes = notes;
     LoadPasswordsToForm();
     LoadIdeasToForm();
     LoadRecordsToForm();
     setIdeaVisible(false);
     setPassVisible(false);
     setRecordsVisible(false);
 }
示例#2
0
        public void TestMethod1()
        {
            /* Granted there is a category created for admin then this testing will be successful.
             * We will test if retrieved number is empty or not that is required for loading notes on Dashboard. */

            ClassNotes gotoclaassnote = new ClassNotes();

            gotoclaassnote.userid123      = 1;
            gotoclaassnote.onecategory123 = 1;
            int Notnull = gotoclaassnote.countnotes();

            Assert.IsNotNull(Notnull);
        }
示例#3
0
        public void AddingNote()
        {
            //--------------------Testing of Addition of a note into the database.

            ClassNotes gotoClassNote = new ClassNotes();

            gotoClassNote.userid123     = 1;
            gotoClassNote.stick123      = "true";
            gotoClassNote.completed123  = "false";
            gotoClassNote.title123      = "Test Title";
            gotoClassNote.content123    = "Test Content";
            gotoClassNote.categoryid123 = 1;
            string Added  = gotoClassNote.insertnotes();
            string Needed = "Note Added!";

            Assert.AreEqual(Needed, Added);
        }
示例#4
0
        public void TestMethod2()
        {
            //Here we are gonna delete   'TestUsername'   user via  'Delete user'   on Dashboard MenuBar.

            //Note, this test will only be successful if the user create test is successful.

            DatabaseConnection DB     = new DatabaseConnection();
            ClassNotes         gotoCN = new ClassNotes();
            string             query1 = "select userid from users where username='******'";
            DataTable          dt1    = DB.retrive(query1);
            int userid = int.Parse(dt1.Rows[0][0].ToString());


            gotoCN.userid123 = userid;
            gotoCN.DeleteAccount();

            string    query2 = "select * from users where username=TestUsername";
            DataTable dt2    = DB.retrive(query2);



            Assert.IsNull(dt2.Rows.Count);
        }