Example #1
0
        public void GetById_WhenCalledNotExistsDebit_ShouldThrowObjectNotFoundException()
        {
            // Arrange
            Guid debitId      = Guid.Empty;
            var  mockDebitDal = new MockDebitDal().MockGet(null);
            var  sut          = new DebitManager(mockDebitDal.Object, null);

            // Act & Assert
            Assert.Throws <ObjectNotFoundException>(() => sut.GetById(debitId));
        }
Example #2
0
        public void GetById_WhenCalledWithId_ShouldReturnDebit()
        {
            // Arrange
            Guid debitId      = Guid.NewGuid();
            var  mockDebitDal = new MockDebitDal().MockGet(new Debit());
            var  sut          = new DebitManager(mockDebitDal.Object, null);

            // Act
            var result = sut.GetById(debitId);

            // Assert
            Assert.NotNull(result.Data);
        }