コード例 #1
0
        private void redactionButton_Click(object sender, RoutedEventArgs e)
        {
            RedactionData data = service.GetPhone(personalGrid, corporativeGrid);

            NavigationService.Navigate(new ViewRedactionPage()
            {
                Phone = data.Phone, Table = data.Table
            });
        }
コード例 #2
0
        public void GetPhone_pGridVisible_NotSelected_ReturnsNullAndNull()
        {
            List <PersonalTelephone> sourse = new List <PersonalTelephone>()
            {
                new PersonalTelephone {
                    PhoneNumber = "1234567890123"
                }
            };
            DataGrid pGrid = new DataGrid()
            {
                ItemsSource = sourse, SelectedItem = null, Visibility = Visibility.Visible
            };
            DataGrid         cGrid   = new DataGrid();
            RedactionService service = new RedactionService();
            RedactionData    result  = service.GetPhone(pGrid, cGrid);

            Assert.IsNull(result.Phone);
            Assert.AreEqual(0, result.Table);
        }
コード例 #3
0
        public void GetPhone_pGridNotVisible_NotSelected_ReturnsNullAndOne()
        {
            List <CorporativeTelephone> sourse = new List <CorporativeTelephone>()
            {
                new CorporativeTelephone {
                    PhoneNumber = "1234567890123"
                }
            };
            DataGrid pGrid = new DataGrid()
            {
                Visibility = Visibility.Collapsed
            };
            DataGrid cGrid = new DataGrid()
            {
                ItemsSource = sourse, SelectedItem = null
            };
            RedactionService service = new RedactionService();
            RedactionData    result  = service.GetPhone(pGrid, cGrid);

            Assert.IsNull(result.Phone);
            Assert.AreEqual(0, result.Table);
        }