Exemple #1
0
        public void Categorize_Click(Object sender, EventArgs e)
        {
            var id = Convert.ToInt32(CustomerIDTextBox.Text);

            OutputLabel.Text = String.Format("Categorizing payments of account: {0}", id);
            var suc = CategorizationServices.CategorizePayments(id);

            if (suc)
            {
                OutputLabel.Text = String.Format("Payments of account: {0} categorized", id);
            }
            else
            {
                OutputLabel.Text = String.Format("Error while categoriing payments of account {0}", id);
            }
        }
Exemple #2
0
        public void CategorizePaymentsTest()
        {
            //Arrange
            var operations = DataHelper.GetOperations();

            int                id                = 2;
            IRepository        repository        = MockRepository.GenerateStub <IRepository>();
            IOperationServices operationServices = MockRepository.GenerateMock <IOperationServices>();

            operationServices.Expect(x => x.GetOperationsByCustomerID(id)).Return(operations);


            //Act
            CategorizationServices target = new CategorizationServices(repository, operationServices);
            var actual = target.CategorizePayments(id);

            //Assert
            Assert.AreEqual(true, actual);
        }