コード例 #1
0
        public void Test_Employee_InvalidEmptyOrNullTelephoneExtension_ShouldBeFail()
        {
            Employee employee = ObjectMotherEmployee.GetEmployeeWithEmptyTelephoneExtension();

            employee.Id = 0;
            Action comparison = employee.Validate;

            comparison.Should().Throw <EmployeeEmptyOrNullTelephoneExtensionException>();
        }
コード例 #2
0
        public void EmployeeService_Update_InvalidEmptyOrNullBranch_ShouldBeFail()
        {
            Employee employee = ObjectMotherEmployee.GetEmployeeWithEmptyTelephoneExtension();

            employee.Id = 1;
            Action executeAction = () => _service.Update(employee);

            executeAction.Should().Throw <EmployeeEmptyOrNullTelephoneExtensionException>();
            _mockRepository.VerifyNoOtherCalls();
        }