public void GetCostReturnusingServiceMock() { Mock <ICostService> mockCostService = new Mock <ICostService>(); mockCostService.Setup(x => x.GetBenefitCost(It.IsAny <Employee>())).Returns(5000); var costController = new CostController(mockCostService.Object); var retcost = costController.GetCost(new Employee()); Assert.AreEqual(retcost, 5000); }
public void GetCostReturnsStatic() { ICostService costService = new CostService(); var costController = new CostController(costService); Employee emp = new Employee() { FirstName = "Kalyani", LastName = "Sundaresan" }; var retcost = costController.GetCost(emp); Assert.AreEqual(retcost, 1000); }
public void TestCostController() { SetMockRepository(); UnitOfWork unitOfWork = new UnitOfWork(MockIncomeRepository, MockCostRepository, MockUsersRepository); CostController costController = new CostController(unitOfWork); var testListAll = costController.GetCostList(); var testListPart = costController.GetCostListByName("Service"); Assert.AreEqual(GetAllTestCosts().Count, testListAll.ToList().Count); Assert.AreEqual(GetPartTestCosts().Count, testListPart.ToList().Count); string testSumDay = costController.GetDaySumForDate("01.01.2020"); string testSumMonth = costController.GetMonthSumForDate("02.2020"); Assert.AreEqual("4000", testSumDay); Assert.AreEqual("6000", testSumMonth); }
public CardsPeriodData(DepartmentDesignation designation, CostController costController, float currentTimeRateNorm) { _departmentParameter = designation; _currentTimeRateNorm = currentTimeRateNorm; _costController = costController; }
private void Awake() { Evaluation = new EvaluationController(_moneyParams); Cost = new CostController(_genParams); }
public void Setup() { _mockQuery = new Mock <ICalculateCostsQuery>(); _mockQuery.Setup(x => x.CalculateCosts(It.IsAny <int>())).Returns(new CostReportViewModel()); _controller = new CostController(_mockQuery.Object); }