Exemple #1
0
        public void ShouldRecognizeAddCommissionedEmployeeCommand(int id, string name, string address, decimal monthlySalary, decimal commissionRate)
        {
            var expectedAddEmployeeCommand = new AddCommissionedEmployeeCommand(id, name, address, monthlySalary, commissionRate);
            var command = $"AddEmp {id} \"{name}\" \"{address}\" C {monthlySalary} {commissionRate}";

            var addEmployeeCommand = AddEmployeeCommandParser.Parse(command);

            addEmployeeCommand.Should().Be(expectedAddEmployeeCommand);
        }
Exemple #2
0
        public void ShouldRecognizeAddHourlyEmployeeCommand(int id, string name, string address, decimal hourlyRate)
        {
            var expectedAddEmployeeCommand = new AddHourlyEmployeeCommand(id, name, address, hourlyRate);
            var command = $"AddEmp {id} \"{name}\" \"{address}\" H {hourlyRate}";

            var addEmployeeCommand = AddEmployeeCommandParser.Parse(command);

            addEmployeeCommand.Should().Be(expectedAddEmployeeCommand);
        }
Exemple #3
0
        public void ShouldErrorWhenCommandStructureIsInappropriate(string command)
        {
            Action commandExecutor = () => AddEmployeeCommandParser.Parse(command);

            commandExecutor.ShouldThrow <AddEmployeeCommandStructureException>();
        }