Beispiel #1
0
        public void Spendings_Repository_GetById_ShouldBeOk()
        {
            //Action
            Spending spendingResult = _repository.GetById(_spendingSeed.Id);

            //Assert
            spendingResult.Should().NotBeNull();
            spendingResult.Should().Be(_spendingSeed);
        }
Beispiel #2
0
        public void Spendings_Repository_Add_ShouldBeOk()
        {
            //Action
            Spending spendingRegistered = _repository.Add(_spending);

            //Verify
            spendingRegistered.Should().NotBeNull();
            spendingRegistered.Id.Should().NotBe(0);
            Spending expectedSpending = _ctx.Spendings.Find(spendingRegistered.Id);

            expectedSpending.Should().NotBeNull();
            expectedSpending.Should().Be(spendingRegistered);
        }
Beispiel #3
0
        public void Spendings_Repository_GetById_ShouldThrowNotFoundException()
        {
            //Action
            int      notFoundId     = 10;
            Spending spendingResult = _repository.GetById(notFoundId);

            //Assert
            spendingResult.Should().BeNull();
        }