public void Salvar(Cliente cliente) { if (_clienteRepository.GetByCpf(cliente.Cpf) != null) throw new ClienteException("Este Cpf já está cadastrado no banco!"); _clienteRepository.Add(cliente); }
public void Inicialize() { var nome = "Mack Teste"; var cpf = "12345678912"; _cliente = new Cliente(nome, cpf); _mockClienteRepository = new Mock<IClienteRepository>(); }
public void Quando_Criar_Um_Cliente_Verificar_Set_Do_Construtor() { var nome = "Mack Teste"; var cpf = "12345678912"; var cliente = new Cliente(nome, cpf); Assert.AreEqual(cliente.Nome, nome); Assert.AreEqual(cliente.Cpf, cpf); }