private void InitializeWindow(Customer customer, IAccountRepository accountRepository, IWindowDialogService windowDialogService)
        {
            _window = new AccountsWindow(customer, accountRepository, windowDialogService);
            _window.Show();

            _datagrid          = _window.FindVisualChildren <DataGrid>().FirstOrDefault();
            _addAccountButton  = _window.GetPrivateFieldValueByName <Button>("AddAccountButton");
            _saveAccountButton = _window.GetPrivateFieldValueByName <Button>("SaveAccountButton");
            _transferButton    = _window.GetPrivateFieldValueByName <Button>("TransferButton");
        }
Exemple #2
0
        private void InitializeWindow(Customer customer)
        {
            _window = new AccountsWindow(customer, _accountRepositoryMock.Object, _accountValidatorMock.Object, _windowDialogServiceMock.Object);
            _window.Show();

            _datagrid          = _window.FindVisualChildren <DataGrid>().FirstOrDefault();
            _addAccountButton  = _window.GetPrivateFieldValueByName <Button>("AddAccountButton");
            _saveAccountButton = _window.GetPrivateFieldValueByName <Button>("SaveAccountButton");
            _transferButton    = _window.GetPrivateFieldValueByName <Button>("TransferButton");
            _errorTextBlock    = _window.GetPrivateFieldValueByName <TextBlock>("ErrorTextBlock");
        }
        private void InitializeWindow(Customer customer)
        {
            _window = new AccountsWindow(customer, _accountServiceMock.Object, _windowDialogServiceMock.Object);
            _window.Show();

            _listView = _window.FindVisualChildren <ListView>().FirstOrDefault();
            Assert.That(_listView, Is.Not.Null, "There should be a ListView defined in the XAML.");
            _newAccountGroupBox = _window.FindVisualChildren <GroupBox>().FirstOrDefault();
            Assert.That(_newAccountGroupBox, Is.Not.Null, "There should be a GroupBox defined in the XAML.");

            //AccountNumberTextBox
            _accountNumberTextBox = _window.GetPrivateFieldValueByName <TextBox>("AccountNumberTextBox");
            Assert.That(_accountNumberTextBox, Is.Not.Null, "There should be a TextBox with the name AccountNumberTextBox.");

            _typeComboBox = _window.FindVisualChildren <ComboBox>().FirstOrDefault();
            Assert.That(_typeComboBox, Is.Not.Null, "There should be a ComboBox defined in the XAML.");

            _addAccountButton = _window.GetPrivateFieldValueByName <Button>("AddAccountButton");
            Assert.That(_addAccountButton, Is.Not.Null, "There should be a Button with the name AddAccountButton.");
            _errorTextBlock = _window.GetPrivateFieldValueByName <TextBlock>("ErrorTextBlock");
            Assert.That(_errorTextBlock, Is.Not.Null, "There should be a TextBlock with the name ErrorTextBlock.");
        }
    public bool?ShowAccountDialogForCustomer(Customer customer)
    {
        var accountsWindow = new AccountsWindow(customer, _accountRepository, _accountValidator, this);

        return(accountsWindow.ShowDialog());
    }
Exemple #5
0
        public void GetAccountList()
        {
            AccountsWindow aw = new AccountsWindow();

            aw.Show();
        }
Exemple #6
0
        protected void ShowAccountsWindowExecuted()
        {
            var accWindow = new AccountsWindow(_core);

            accWindow.ShowDialog();
        }
        private void EditAccounts_Click(object sender, RoutedEventArgs e)
        {
            AccountsWindow accountsWindow = new AccountsWindow();
            accountsWindow.ShowDialog();

            InitAccounts();
        }