Exemple #1
0
        public void WhenCalled_ShouldReturnsAllClients()
        {
            //Arrange

            //Act
            var clients = _sut.Get();

            //Assert
            Assert.NotNull(clients);
        }
Exemple #2
0
        public void WhenCalled_ShouldReturnClientWithSameId()
        {
            //Arrange
            var clientId = _sut.Get().First().Id;

            //Act
            var client = _sut.GetById(clientId);

            //Assert
            Assert.Equal(clientId, client.Id);
        }
Exemple #3
0
        public void WhenGivenClient_ShouldRemoveClientFromMemory()
        {
            //Arrange
            var clientId      = _sut.Get().FirstOrDefault().Id;
            var deletedClient = _sut.GetById(clientId);

            //Act
            _sut.Delete(deletedClient);

            //Assert
            var clients = _sut.Get();

            Assert.DoesNotContain(deletedClient, clients);
        }
Exemple #4
0
        public void WhenGivenClient_ShouldChangeClientWithSameId()
        {
            //Arrange
            var client = _sut.Get().FirstOrDefault();

            client.Nome     = "Novo Nome";
            client.Endereco = "Novo Endereco";
            client.Celular  = "Novo Celular";
            client.CPF      = "Novo CPF";
            client.Email    = "Novo Email";

            //Act
            var editClient = _sut.Edit(client);

            //Assert
            var existingClient = _sut.GetById(editClient.Id);

            Assert.Equal(existingClient, editClient);
        }