public void AddTaxEventCallsITaxesServiceAddAndReassignsToGridWithExtraRow()
        {
            _mockTaxesView.ShowTaxes += null;
            LastCall.IgnoreArguments();
            _mockTaxesView.AddTax += null;
            var addTaxEventRaiser = LastCall.IgnoreArguments().GetEventRaiser();
            const string taxType = "pstTax";
            DateTime? startDate = DateTime.Today;
            DateTime? endDate = DateTime.Today.AddYears(1);
            const JurisdictionEnum jurisdiction = JurisdictionEnum.ProvinceState;
            const int percent = 5;
            Expect.Call(_mockTaxesView.TaxType).Return(taxType);
            Expect.Call(_mockTaxesView.StartDate).Return(startDate);
            Expect.Call(_mockTaxesView.EndDate).Return(endDate);
            Expect.Call(_mockTaxesView.Jurisdiction).Return(jurisdiction);
            Expect.Call(_mockTaxesView.Percent).Return(percent);
            var tax = new Tax(taxType, startDate, endDate, jurisdiction, percent);
            _mockTaxesService.AddTax(tax);
            var taxes = new List<Tax> { tax };
            Expect.Call(_mockTaxesService.Taxes).Return(taxes);
            _mockTaxesView.TaxesDisplay = taxes;

            _mockRepository.ReplayAll();

            var taxesPresenter = new TaxesPresenter(_mockTaxesService, _mockTaxesView);
            addTaxEventRaiser.Raise(_mockTaxesView, EventArgs.Empty);
        }
        public void AddTaxEventCallsITaxesServiceAddAndReassignsToGridWithExtraRow()
        {
            _mockTaxesView.ShowTaxes += null;
            LastCall.IgnoreArguments();
            _mockTaxesView.AddTax += null;
            var                    addTaxEventRaiser = LastCall.IgnoreArguments().GetEventRaiser();
            const string           taxType           = "pstTax";
            DateTime?              startDate         = DateTime.Today;
            DateTime?              endDate           = DateTime.Today.AddYears(1);
            const JurisdictionEnum jurisdiction      = JurisdictionEnum.ProvinceState;
            const int              percent           = 5;

            Expect.Call(_mockTaxesView.TaxType).Return(taxType);
            Expect.Call(_mockTaxesView.StartDate).Return(startDate);
            Expect.Call(_mockTaxesView.EndDate).Return(endDate);
            Expect.Call(_mockTaxesView.Jurisdiction).Return(jurisdiction);
            Expect.Call(_mockTaxesView.Percent).Return(percent);
            var tax = new Tax(taxType, startDate, endDate, jurisdiction, percent);

            _mockTaxesService.AddTax(tax);
            var taxes = new List <Tax> {
                tax
            };

            Expect.Call(_mockTaxesService.Taxes).Return(taxes);
            _mockTaxesView.TaxesDisplay = taxes;

            _mockRepository.ReplayAll();

            var taxesPresenter = new TaxesPresenter(_mockTaxesService, _mockTaxesView);

            addTaxEventRaiser.Raise(_mockTaxesView, EventArgs.Empty);
        }
Esempio n. 3
0
 //**************************************************
 //*             FILL DATA ON START
 //**************************************************
 private void InitializeFormWithData()
 {
     _taxesPresenter = new TaxesPresenter(new TaxesServices());
     searchTaxTextBox.PreviewTextInput += searchTaxTextBox.OnlyLettersValidationTextBox;
     taxNameTextBox.PreviewTextInput   += taxNameTextBox.OnlyLettersValidationTextBox;
     percentageTaxTextBox.TextBoxPropertiesConfigurations(2, 1, 1, TextAlignment.Left);
     percentageTaxTextBox.PreviewTextInput += percentageTaxTextBox.OnlyNumbersValidationTextBox;
     taxGrid.ItemsSource         = taxesList;
     activateTaxChkBox.IsChecked = true;
     getAllTaxes();
 }
        public void TaxesPresenterAttachesViewEventHandlersOnConstruction()
        {
            _mockTaxesView.ShowTaxes += null;
            LastCall.IgnoreArguments();
            _mockTaxesView.AddTax += null;
            LastCall.IgnoreArguments();

            _mockRepository.ReplayAll();

            var taxesPresenter = new TaxesPresenter(_mockTaxesService, _mockTaxesView);
        }
        public void ShowTaxesEventDisplayAllTaxes()
        {
            _mockTaxesView.ShowTaxes += null;
            var showTaxesEventRaiser = LastCall.IgnoreArguments().GetEventRaiser();
            _mockTaxesView.AddTax += null;
            LastCall.IgnoreArguments();
            var taxes = new List<Tax>();
            Expect.Call(_mockTaxesService.Taxes).Return(taxes);
            _mockTaxesView.TaxesDisplay = taxes;

            _mockRepository.ReplayAll();

            var taxesPresenter = new TaxesPresenter(_mockTaxesService, _mockTaxesView);
            showTaxesEventRaiser.Raise(_mockTaxesView, EventArgs.Empty);
        }
        public void ShowTaxesEventDisplayAllTaxes()
        {
            _mockTaxesView.ShowTaxes += null;
            var showTaxesEventRaiser = LastCall.IgnoreArguments().GetEventRaiser();

            _mockTaxesView.AddTax += null;
            LastCall.IgnoreArguments();
            var taxes = new List <Tax>();

            Expect.Call(_mockTaxesService.Taxes).Return(taxes);
            _mockTaxesView.TaxesDisplay = taxes;

            _mockRepository.ReplayAll();

            var taxesPresenter = new TaxesPresenter(_mockTaxesService, _mockTaxesView);

            showTaxesEventRaiser.Raise(_mockTaxesView, EventArgs.Empty);
        }
        public void TaxesPresenterAttachesViewEventHandlersOnConstruction()
        {
            _mockTaxesView.ShowTaxes += null;
            LastCall.IgnoreArguments();
            _mockTaxesView.AddTax += null;
            LastCall.IgnoreArguments();

            _mockRepository.ReplayAll();

            var taxesPresenter = new TaxesPresenter(_mockTaxesService, _mockTaxesView);
        }