示例#1
0
        public void ChangeAbsentDescriptionTest()
        {
            string word = "Generator";

            Conception.LanguageId languageIdEng = Conception.LanguageId.English;
            m_Conception.ChangeDescription(word, languageIdEng);
        }
示例#2
0
        public void AddExisitingLanguageDescriptionTest()
        {
            string word = "Генератор2";

            Conception.LanguageId languageIdRus = Conception.LanguageId.Russian;
            m_Conception.AddDescription(word, languageIdRus);
        }
示例#3
0
        private void CheckRegistryDescription(string word, Conception.LanguageId languageId)
        {
            ConceptionDescription description = m_Conception.GetConceptionDescription(languageId);
            bool ignoreCase = true;

            Assert.AreEqual(word, description.ConceptionRegistryDescription, ignoreCase);
        }
        private void btnAddConception_Click(object sender, RoutedEventArgs e)
        {
            Conception.LanguageId languageForEdit = (Conception.LanguageId)cmbChangeforEdit.SelectedIndex;
            m_Dictionary.AddConception(txtEditDescription.Text, languageForEdit);

            UpdateAllControls();
        }
示例#5
0
        public void GetConceptionDescriptionTest()
        {
            Conception.LanguageId languageIdRus = Conception.LanguageId.Russian;
            string word = "Генератор";

            CheckRegistryDescription(word, languageIdRus);
        }
示例#6
0
        public void MyTestInitialize()
        {
            int    conceptionId = 1;
            string description  = "Генератор";

            Conception.LanguageId languageId = Conception.LanguageId.Russian;
            m_Conception = new Conception(conceptionId, description, languageId);
        }
        public int AddConception(string word, Conception.LanguageId languageId)
        {
            int        newConceptionId = m_Dictionary.Count > 0 ? m_Dictionary.Last().Key + 1 : 1;
            Conception newConception   = new Conception(newConceptionId, word, languageId);

            m_Dictionary.Add(newConception.ConceptionId, newConception);
            return(newConception.ConceptionId);
        }
        public void AddDescriptionOfExisitingLanguageToConceptionTest()
        {
            int conceptionId = AddConceptionRus();

            string word = "Генератор2";

            Conception.LanguageId languageIdRus = Conception.LanguageId.Russian;
            m_Dictionary.AddDescriptionToConception(conceptionId, word, languageIdRus);
        }
        private int AddConceptionRus()
        {
            string word = "Генератор";

            Conception.LanguageId languageId = Conception.LanguageId.Russian;

            int conceptionId = m_Dictionary.AddConception(word, languageId);

            return(conceptionId);
        }
        public void AddDescriptionToAbsentConceptionTest()
        {
            int conceptionId = AddConceptionRus();

            string wordEng = "Generator";

            Conception.LanguageId languageIdEng = Conception.LanguageId.English;
            int nonExistingConceptionId         = 2;

            m_Dictionary.AddDescriptionToConception(nonExistingConceptionId, wordEng, languageIdEng);
        }
        public void RemoveDescriptionFromConception(int conceptionId, Conception.LanguageId languageId)
        {
            Conception handledConception = GetConception(conceptionId);

            handledConception.RemoveDescription(languageId);

            if (handledConception.DescriptionsCount == 0)
            {
                RemoveConception(conceptionId);
            }
        }
示例#12
0
        public void AddDescriptionTest()
        {
            string word = "Generator";

            Conception.LanguageId languageIdEng = Conception.LanguageId.English;
            m_Conception.AddDescription(word, languageIdEng);

            int expected = 2;

            Assert.AreEqual(expected, m_Conception.DescriptionsCount);
        }
        public void ChangeDescriptionOfAbsentConceptionTest()
        {
            int conceptionId = AddConceptionRus();

            string word = "Генерато2";

            Conception.LanguageId languageIdEng = Conception.LanguageId.Russian;
            int nonExistingConceptionId         = 2;

            m_Dictionary.ChangeDescriptionOfConception(nonExistingConceptionId, word, languageIdEng);
        }
        public void GetConceptionsCountOneTest()
        {
            string wordRus = "Генератор";

            Conception.LanguageId languageIdRus = Conception.LanguageId.Russian;
            m_Dictionary.AddConception(wordRus, languageIdRus);

            int excpected = 1;
            int actual    = m_Dictionary.ConceptionsCount;

            Assert.AreEqual(excpected, actual);
        }
        public void ChangeDescriptionOfConceptionTest()
        {
            int conceptionId = AddConceptionRus();

            string word = "Генерато2";

            Conception.LanguageId languageIdEng = Conception.LanguageId.Russian;
            m_Dictionary.ChangeDescriptionOfConception(conceptionId, word, languageIdEng);

            int expected = 1;

            Assert.AreEqual(expected, m_Dictionary.ConceptionsCount);
        }
示例#16
0
        public void ChangeDescriptionTest()
        {
            string word = "Генератор2";

            Conception.LanguageId languageIdRus = Conception.LanguageId.Russian;
            m_Conception.ChangeDescription(word, languageIdRus);

            int expected = 1;

            Assert.AreEqual(expected, m_Conception.DescriptionsCount);

            CheckRegistryDescription(word, languageIdRus);
        }
        public void AddDescriptionToConceptionTest()
        {
            int conceptionId = AddConceptionRus();

            string wordEng = "Generator";

            Conception.LanguageId languageIdEng = Conception.LanguageId.English;
            m_Dictionary.AddDescriptionToConception(conceptionId, wordEng, languageIdEng);

            int expected = 1;

            Assert.AreEqual(expected, m_Dictionary.ConceptionsCount);
        }
        private void btnRemoveDescription_Click(object sender, RoutedEventArgs e)
        {
            Conception conception = (Conception)listConceptions.SelectedItem;

            if (conception == null)
            {
                return;
            }

            Conception.LanguageId languageForEdit = (Conception.LanguageId)cmbChangeforEdit.SelectedIndex;
            m_Dictionary.RemoveDescriptionFromConception(conception.ConceptionId, languageForEdit);

            UpdateAllControls();
        }
示例#19
0
        public void RemoveDescriptionTest()
        {
            string word = "Generator";

            Conception.LanguageId languageIdEng = Conception.LanguageId.English;
            m_Conception.AddDescription(word, languageIdEng);

            int expected = 2;

            Assert.AreEqual(expected, m_Conception.DescriptionsCount);

            m_Conception.RemoveDescription(Conception.LanguageId.Russian);

            CheckRegistryDescription(word, Conception.LanguageId.English);
        }
        public void RemoveDescriptionFromAbsentConceptionTest()
        {
            int conceptionId = AddConceptionRus();

            string wordEng = "Generator";

            Conception.LanguageId languageIdEng = Conception.LanguageId.English;
            int expected = 1;

            m_Dictionary.AddDescriptionToConception(conceptionId, wordEng, languageIdEng);
            Assert.AreEqual(expected, m_Dictionary.ConceptionsCount);

            int nonExistingConceptionId = 2;

            m_Dictionary.RemoveDescriptionFromConception(nonExistingConceptionId, languageIdEng);
        }
        private void UpdateDescription()
        {
            Conception conception = (Conception)listConceptions.SelectedItem;

            if (conception == null)
            {
                return;
            }

            if (chkAllLanguages.IsChecked == true)
            {
                txtDescription.Text = GetAllDescriptions(conception);
            }
            else
            {
                Conception.LanguageId languageForDescription = (Conception.LanguageId)cmbLanguageForDescription.SelectedIndex;
                txtDescription.Text = GetConceptionDescription(conception, languageForDescription);
            }
        }
        private void UpdateEditDescription()
        {
            Conception conception = (Conception)listConceptions.SelectedItem;

            if (conception == null)
            {
                if (btnRemoveConception != null)
                {
                    btnRemoveConception.IsEnabled = false;
                }
                return;
            }

            Conception.LanguageId languageForEdit = (Conception.LanguageId)cmbChangeforEdit.SelectedIndex;
            txtEditDescription.Text = GetConceptionDescription(conception, languageForEdit);

            bool isDescriptionExists = !string.IsNullOrWhiteSpace(txtEditDescription.Text);

            btnAddDescription.IsEnabled    = !isDescriptionExists;
            btnChangeDescription.IsEnabled = isDescriptionExists;
            btnRemoveDescription.IsEnabled = isDescriptionExists;
            btnRemoveConception.IsEnabled  = true;
        }
 public void ChangeDescriptionOfConception(int conceptionId, string word, Conception.LanguageId languageId)
 {
     GetConception(conceptionId).ChangeDescription(word, languageId);
 }
示例#24
0
 public void GetAbsentConceptionDescriptionTest()
 {
     Conception.LanguageId languageId  = Conception.LanguageId.English;
     ConceptionDescription description = m_Conception.GetConceptionDescription(languageId);
 }
 private string GetConceptionDescription(Conception conception, Conception.LanguageId languageForDescription)
 {
     return(conception.GetConceptionDescription(languageForDescription).ConceptionRegistryDescription);
 }
 public void AddDescriptionToConception(int conceptionId, string word, Conception.LanguageId languageId)
 {
     GetConception(conceptionId).AddDescription(word, languageId);
 }