public static BudgetItem ToBudgetItem(this BudgetItemDetailsViewModel model, IKapitalRepository repository, User user)
 {
     return new BudgetItem()
                {
                    Id = model.Id,
                    Name = model.Name,
                    Amount = model.Amount,
                    Tag = repository.GetTagByUserAndName(user.UserId, model.Tag),
                    Recur = model.Recur,
                    ScheduledDate = model.ScheduledDate,
                    TimePeriod = model.TimePeriod.ToEnum(),
                    TimePeriodCount = model.TimePeriodCount,
                    DayCount = model.DayCount
                };
 }
Example #2
0
        public void Init()
        {
            _repository = MockRepository.GenerateMock<IKapitalRepository>();
            _id = Guid.NewGuid();

            var account = new Account();

            _repository.Stub(x => x.GetAccount(_id)).Throw(new ArgumentException("Account not found"));

            try
            {
                _result = _repository.GetAccount(_id);
            }
            catch (Exception e)
            {
                _caughtException = e;
            }

            _repository.VerifyAllExpectations();
        }
Example #3
0
 public TagsController(IKapitalRepository repository, ITagService tagService)
     : base(repository)
 {
     TagService = tagService;
 }
Example #4
0
 public BankController(IKapitalRepository repository)
     : base(repository)
 {
 }
Example #5
0
 public SecureController(IKapitalRepository repository)
     : base(repository)
 {
 }
Example #6
0
 public BaseController(IKapitalRepository repository)
 {
     _repository = repository;
 }
Example #7
0
 public BudgetController(IKapitalRepository repository)
     : base(repository)
 {
 }
Example #8
0
 public KapitalMvcController(IKapitalRepository repository)
 {
     _repository = repository;
 }
Example #9
0
 public KapitalMvcController()
 {
     _repository = RepositoryFactory.Create(RepositoryTypeName);
 }
Example #10
0
 public AccountController(IKapitalRepository repository, ITransactionImporter importer)
     : base(repository)
 {
     TransactionImporter = importer;
 }
 public void Init()
 {
     _repository = RepositoryFactory.Create();
     _mongoRepository = RepositoryFactory.Create("mongo");
     _nonExistantRepository = RepositoryFactory.Create("I Don't Exist");
 }
Example #12
0
 public HomeController(IKapitalRepository repository)
     : base(repository)
 {
 }
 public void Init()
 {
     _repository = MockRepository.GenerateMock<IKapitalRepository>();
 }
Example #14
0
 public MaintenanceController(IKapitalRepository repository)
 {
     Repository = repository;
 }
Example #15
0
 public MemberController(IKapitalRepository repository)
 {
     Repository = repository;
     ErrorHandler = HandlerFactory.CreateErrorHandler();
 }