private void SolveFinancialRequestItem_Click(object sender, EventArgs e) { var selectedRequest = (FinancialRequest)financialRequestDataGridView.CurrentRow.DataBoundItem; FinancialRequestController financialRequestController = new FinancialRequestController(); financialRequestController.SolveFinancialRequest(selectedRequest, (sender as MenuItem).Text); SetFinancialRequests(); }
public void SolveFinancialRequestTest() { // Arrange financialRequestController.AddFinancialRequest(RequestingDepartment.Administration, new Event(), "122", "test", new User("test", "test", User.Roles.AdministrationDepartmentManager)); int oldCount = financialRequestController.GetFinancialRequests().Where(x => x.Result == true).ToList().Count; // Act financialRequestController.SolveFinancialRequest(financialRequestController.GetFinancialRequests()[0], "approve"); List <FinancialRequest> financialRequests = financialRequestController.GetFinancialRequests().Where(x => x.Result == true).ToList(); // Assert Assert.AreEqual(oldCount + 1, financialRequests.Count); }