public void CreateTransaction_WithValidTransaction_ShouldSaveAndReturnId()
        {
            // Arrange
            var transaction = new Transaction
            {
                Amount     = 123.45m,
                CategoryId = 101,
                Date       = DateTime.Today,
                IsCredit   = true,
                Memo       = "This is a test"
            };

            using var dbContext = GetDbContext();

            var service = new TransactionsDataService(dbContext);

            // Act
            var result = service.CreateTransaction(transaction);

            // Assert
            Assert.AreNotEqual(default, result, FailureMessages.ResultNotExpectedValue);
        public void CreateTransaction_WithNullTransaction_ShouldThrowException()
        {
            // Arrange
            using var dbContext = GetDbContext();

            var service = new TransactionsDataService(dbContext);

            Exception caughtException = null;

            // Act
            try
            {
                service.CreateTransaction(null);
            }
            catch (Exception exception)
            {
                caughtException = exception;
            }

            // Assert
            Assert.IsNotNull(caughtException, FailureMessages.ExceptionNotThrown);
            Assert.IsInstanceOfType(caughtException, typeof(ArgumentNullException), FailureMessages.ExceptionNotExpectedType);
        }