public void DatabaseHelperConstructorTest()
        {
            string sConnectionString = string.Empty; // TODO: Initialize to an appropriate value

            DatabaseHelper.DatabaseHelper target = new DatabaseHelper.DatabaseHelper(sConnectionString);
            Assert.Inconclusive("TODO: Implement code to verify target");
        }
        public void UpdateWordTest()
        {
            string sConnectionString = string.Empty;                                                     // TODO: Initialize to an appropriate value

            DatabaseHelper.DatabaseHelper target = new DatabaseHelper.DatabaseHelper(sConnectionString); // TODO: Initialize to an appropriate value
            string sWord = string.Empty;                                                                 // TODO: Initialize to an appropriate value

            target.UpdateWord(sWord);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }
        public void GetWordTest()
        {
            string sConnectionString = string.Empty;                                                     // TODO: Initialize to an appropriate value

            DatabaseHelper.DatabaseHelper target = new DatabaseHelper.DatabaseHelper(sConnectionString); // TODO: Initialize to an appropriate value
            string   sWord    = string.Empty;                                                            // TODO: Initialize to an appropriate value
            WordItem expected = null;                                                                    // TODO: Initialize to an appropriate value
            WordItem actual;

            actual = target.GetWord(sWord);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
        public void AddRelationTest()
        {
            string sConnectionString = string.Empty;                                                     // TODO: Initialize to an appropriate value

            DatabaseHelper.DatabaseHelper target = new DatabaseHelper.DatabaseHelper(sConnectionString); // TODO: Initialize to an appropriate value
            string       sParent     = string.Empty;                                                     // TODO: Initialize to an appropriate value
            string       sChild      = string.Empty;                                                     // TODO: Initialize to an appropriate value
            bool         isTentative = false;                                                            // TODO: Initialize to an appropriate value
            RelationItem expected    = null;                                                             // TODO: Initialize to an appropriate value
            RelationItem actual;

            actual = target.AddRelation(sParent, sChild, RelationType.Normal, 0);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
        public void GetWordByIdTest()
        {
            string sConnectionString = string.Empty;

            DatabaseHelper.DatabaseHelper target = new DatabaseHelper.DatabaseHelper(sConnectionString);

            int      nId       = 1;
            WordItem expected  = target.AddWord("тест1", false);
            WordItem expected2 = target.AddWord("тест2", false);

            WordItem actual;

            actual = target.GetWordById(nId);
            Assert.AreEqual(expected, actual);
            Assert.AreNotEqual(expected2, actual);
        }
Exemple #6
0
        private async void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            bool     acquirebut_check = checkBox1.Checked;
            IDocFile WinVFile         = newExp.GetDocument();

Start_Camera:
            if (checkBox1.Checked == true)
            {
                DBHelper = new DatabaseHelper.DatabaseHelper(serverSettings.MemcachedServerIP, serverSettings.DatabaseServerIP, serverSettings.Username, serverSettings.Password, serverSettings.DBName);
                experiment_check();
                if (exp_check == 0)
                {
                    newExp.Start(WinVFile);
                }
                WinVFile = newExp.GetDocument();
Check_Camera:
                experiment_check();
                if (checkBox1.Checked == false)
                {
                    WinVFile.Close();
                    newExp.Stop();
                    goto End;
                }
                if (exp_check == 1)
                {
                    await PutTaskDelay();

                    goto Check_Camera;
                }
                else if (exp_check == 0)
                {
                    process_data(WinVFile);
                    goto Start_Camera;
                }
            }
            else
            {
                WinVFile.Close();
                newExp.Stop();
            }
End:
            int random;
        }
        public void SetStatusTest()
        {
            string sConnectionString = string.Empty;                                                     // TODO: Initialize to an appropriate value

            DatabaseHelper.DatabaseHelper target = new DatabaseHelper.DatabaseHelper(sConnectionString); // TODO: Initialize to an appropriate value
            string sWord = "test4";

            WordItem expected = new WordItem();

            expected.Status   = (short)WordStatus.InProgress;
            expected.Reviewed = false;
            expected.InMainDB = true;
            DateTime now = DateTime.UtcNow;

            expected.StatusLastTimeUpdate = now;
            expected.Word = "test4";
            WordItem actual;

            actual = target.SetStatus(sWord, (WordStatus)expected.Status, (short)0, false);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
        public void AddWordTest()
        {
            string sConnectionString = string.Empty;

            DatabaseHelper.DatabaseHelper target = new DatabaseHelper.DatabaseHelper(sConnectionString);
            string sWord = "TestWord1";

            target.RemoveWord(sWord);
            bool bSave = false;

            WordItem actual;

            actual = target.AddWord(sWord, bSave);
            WordItem expected = target.GetWord(sWord);

            Assert.IsNull(expected);

            bSave    = true;
            actual   = target.AddWord(sWord, bSave);
            expected = target.GetWord("тест1");
            Assert.AreNotEqual(expected, actual);
            expected = target.GetWord(sWord);
            Assert.AreEqual(expected, actual);
        }
Exemple #9
0
 public Form2()
 {
     InitializeComponent();
     DBHelper = new DatabaseHelper.DatabaseHelper(serverSettings.MemcachedServerIP, serverSettings.DatabaseServerIP, serverSettings.Username, serverSettings.Password, serverSettings.DBName);
 }