Exemplo n.º 1
0
        public void Loan_CalculateFine_ShouldBeOk()
        {
            _book.Object.Id           = 1;
            _book.Object.Availability = false;
            _loan = ObjectMother.GetLoanInvalidDevolution(_book.Object);

            var resultExpected = _loan.CalculateFine();

            resultExpected.Should().Be(7.50);
        }
Exemplo n.º 2
0
        public void Loan_DomainTests_CalculateFine_NoFine_ShouldBeOk()
        {
            var expectedFine = 0;

            _fakeBook.Setup(b => b.IsAvaliable).Returns(true);
            _loan = ObjectMother.GetLoanOk(_fakeBook.Object);
            _loan.DateDevolution = DateTime.Now.AddDays(+1);

            _loan.CalculateFine();

            _loan.Fine.Should().Be(expectedFine);
        }
Exemplo n.º 3
0
        public void Loan_CreateValid_ShouldBeOk()
        {
            _book.Object.Id           = 1;
            _book.Object.Availability = true;
            _loan = ObjectMother.GetLoan(_book.Object);

            _loan.Validate();
            _loan.CalculateFine();

            _loan.Id.Should().Be(1);
            _loan.LoanBook.Should().NotBeNull();
        }