public void ShouldShowEditExpenseView() { var investment = new CashStatement(01.02.of2009(), 10, "salary"); Run(investment); Assert.IsTrue(view.IsShown); }
public void ShouldDisplayDataOfExpenseBeingEdited() { var expense = new CashStatement(01.02.of2009(), -10, "lost some money"); Run(expense); AreEqual(10, view.Transfer.Amount); }
public void ShouldDisplayDataOfInvestmentBeingEdited() { var investment = new CashStatement(01.02.of2009(), 10, "salary"); Run(investment); AreEqual(01.02.of2009(), view.Transfer.Date); AreEqual(10, view.Transfer.Amount); AreEqual("salary", view.Transfer.Description); }
void IEditCashMovementUseCase.Run(CashStatement statement) { if (statement.Amount > 0) { Edit("доход", statement); } else { NegateAmountWhen().Edit("трату", statement); } }
public void ShouldReplaceDataOfExpenseWithNewValuesWhenOkClicked() { var expense = new CashStatement(01.02.of2009(), -10, "lost some money"); Run(expense); view.Transfer.Amount = 20; view.OnOK(); AreEqual(-20, expense.Amount); }
private static PEBudgetRow CreatePEBudgetRow(CashStatement transfer, string description, Action <CashStatement> delete, Action <CashStatement> edit, Func <CashStatement, string> amount, Week currentWeek, Color currentWeekColor) { return(new PEBudgetRow { OnEdit = () => edit(transfer), OnDelete = () => delete(transfer), Event = description ?? transfer.Description, Date = transfer.Date.ToString("d"), Amount = amount(transfer), BackgroundColor = currentWeek != null && currentWeek.Contains(transfer.Date) ? currentWeekColor : PEBudgetRow.Default, }); }
private void Edit(string transferName, CashStatement transfer) { this.transfer = transfer; view.Transfer = peTransfer = new PETransfer { Date = transfer.Date, Amount = negateAmount(transfer.Amount), Description = transfer.Description, }; view.Text = "Изменить " + transferName; view.OnOK = OnTransferIsEdited; view.Show(); }
public void DeleteRemainder() { ArrangeWeeks(02.02.of2009()); var transfer1 = new CashStatement(03.02.of2009(), 10, "1"); var transfer2 = new CashStatement(04.02.of2009(), 20, "2"); budget.Remainders = new[] { transfer1, transfer2 }; ExpectDeletion(x => x.DeleteRemainder(transfer1)); // Run(); view.CalculationResultsFake.DataSource.ElementAt(2).Delete(); }
public void ShouldReplaceDataOfInvestmentWithNewValuesWhenOkClicked() { var investment = new CashStatement(01.02.of2009(), 10, "salary"); Run(investment); view.Transfer.Date = 02.03.of2009(); view.Transfer.Amount = 20; view.Transfer.Description = "bonus"; view.OnOK(); AreEqual(02.03.of2009(), investment.Date); AreEqual(20, investment.Amount); AreEqual("bonus", investment.Description); }
void IEditRemainderUseCase.Run(CashStatement statement) { Edit("остаток", statement); }
private void Run(CashStatement investment) { var useCase = (IEditCashMovementUseCase) new EditCashStatementUseCase(dataSavingServiceMock.Object, view); useCase.Run(investment); }
private void OnEditRemainder(CashStatement remainder) { ObjectFactory.GetInstance <IEditRemainderUseCase>().Run(remainder); }
private void OnEditCashMovement(CashStatement investment) { ObjectFactory.GetInstance <IEditCashMovementUseCase>().Run(investment); }
public void DeleteCashMovement(CashStatement movement) { Delete(data.CashMovements, movement); }
public void DeleteRemainder(CashStatement remainder) { Delete(data.Remainders, remainder); }