public static void GetClientes() { ClienteController.AddCliente(1, "Jackson"); ClienteController.AddCliente(2, "João"); ClienteController.AddCliente(1, "José"); foreach (Cliente cliente in ClienteController.Clientes()) { Console.WriteLine(cliente); } }
public void AddClientTest() { //Arrange var newCliente = new Cliente() { Nome = "Joana", CPF = "529.982.247-25", DataNascimento = "01/05/2001", ClientesEnderecos = null }; var mockRepo = new Mock <IClientRepository>(); mockRepo.Setup(x => x.SaveChanges()).Returns(true); var controller = new ClienteController(mockRepo.Object); //Act ActionResult actionResult = controller.AddCliente(newCliente); //Assert Assert.IsInstanceOfType(actionResult, typeof(OkObjectResult)); }