using System;

using Domain;
using Services;

using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace ServiceTests
{
    [TestClass]
    public class AccountServiceTests
    {
        [TestMethod]
        public void AddingTransactionToAccountDelegatesToAccountInstance()
        {
            // Przygotuj.
            var account = new Account();
            var fakeRepository = new FakeAccountRepository(account);
            var sut = new AccountService(fakeRepository);

            // Wykonaj.
            sut.AddTransactionToAccount("Konto firmowe", 200m);

            // Zweryfikuj.
            Assert.AreEqual(200m, account.Balance);
        }
    }
}
