예제 #1
0
        public void TestFindExistentEntity()
        {
            var created = InterestFactory.Create();
            var finded  = _repository.Find(created.Id);

            Assert.AreEqual(created.Id, finded.Id);
        }
예제 #2
0
        public void TestSave()
        {
            var interest = InterestFactory.Build();

            _repository.Save(interest);
            Assert.IsNotNull(interest.Id);
        }
예제 #3
0
        public void Update()
        {
            var created = InterestFactory.Create();

            created.Value = 300.00m;
            _repository.Update(created);

            var finded = _repository.Find(created.Id);

            Assert.AreEqual(300.00m, finded.Value);
        }
예제 #4
0
        public void TestCount(int count)
        {
            var account = AccountFactory.Create();

            for (int i = 0; i < count; i++)
            {
                InterestFactory.Create(x => x.Account = account);
            }

            Assert.AreEqual(count, _repository.Count());
        }
예제 #5
0
        public void TestUpdatedEntityd()
        {
            var created = InterestFactory.Create();

            //update value
            created.Value += 2;
            _repository.Update(created);

            //check
            var finded = _repository.Find(created.Id);

            Assert.AreEqual(created.Value, finded.Value);
        }
        public void Init()
        {
            _interestCalculatorMock = new Mock <IInterestCalculator>();

            _interestFactory = new InterestFactory(_interestCalculatorMock.Object);
        }