Exemplo n.º 1
0
        private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (!_loaded)
            {
                return;
            }
            ConstantCategory cat = ConstantCategory.Mathematical;
            bool             res = Enum.TryParse <ConstantCategory>(CbSelector.SelectedItem.ToString(), out cat);

            if (!res)
            {
                cat = ConstantCategory.Mathematical;
            }
            _constants.Category = cat;
        }
Exemplo n.º 2
0
        protected override void SeedMockEntityList(IList <Constant> mockEntityList)
        {
            ConstantCategoryUnitTestHelper categoryHelper = new ConstantCategoryUnitTestHelper();
            IList <ConstantCategory>       categoryList   = categoryHelper.CreateSampleEntityList(2, 10);

            for (int i = 0; i < categoryList.Count; i++)
            {
                ConstantCategory cat = categoryList[i];
                cat.ID = i + 1;
            }

            IList <Constant> createdList = CreateSampleEntityList(10, 100);

            for (int i = 0; i < createdList.Count; i++)
            {
                ConstantCategory category = categoryList[_rand.Next() % categoryList.Count];
                createdList[i].ID = i + 1;
                createdList[i].ConstantCategory   = category;
                createdList[i].ConstantCategoryID = category.ID;
                mockEntityList.Add(createdList[i]);
            }
        }