private void SetuUpSalaryStrategyFactory() { var salaryStrategy = new Mock <ISalaryStrategy>(); salaryStrategy.Setup(x => x.CalculateSalary(It.IsAny <byte>())).Returns(new Func <byte, decimal>(x => x)); var salaryServiceFactory = new Mock <ISalaryStrategyFactory>(); salaryServiceFactory.Setup(x => x.CreateStrategy(It.IsAny <ContactType>())).Returns(new Func <ContactType, ISalaryStrategy>(x => salaryStrategy.Object)); _salaryStrategyFactory = salaryServiceFactory.Object; }
public SalaryService(ISalaryStrategyFactory salaryStrategyFactory) { _salaryStrategyFactory = salaryStrategyFactory; }
public void SetUp() { _salaryStrategyFactory = new SalaryStrategyFactory(); }