Example #1
0
        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;
        }
Example #2
0
 public SalaryService(ISalaryStrategyFactory salaryStrategyFactory)
 {
     _salaryStrategyFactory = salaryStrategyFactory;
 }
 public void SetUp()
 {
     _salaryStrategyFactory = new SalaryStrategyFactory();
 }