public void SetUp()
        {
            // setup fake model
            _dbAssetType = new AssetType {
                Id = 1, Name = "a", IsActive = true
            };
            _dbAsset = new Asset
            {
                Id          = 2,
                AssetTypeId = _dbAssetType.Id,
                AssetType   = _dbAssetType, // setup include
                Name        = "b",
                IsActive    = true
            };
            _dbSettingType = new SettingType {
                Id = 3, Name = "c", IsActive = true
            };
            _dbAssetSetting = new AssetSetting
            {
                Id            = 4,
                AssetId       = _dbAsset.Id,
                Asset         = _dbAsset,       // setup include
                SettingTypeId = _dbSettingType.Id,
                SettingType   = _dbSettingType, // setup include
                Value         = "d",
                IsActive      = true
            };

            // setup DbContext
            Setup_FakeDbContext();

            // setup repository
            _repository = new AssetSettingRepository(_fakeDbContext);
        }
Esempio n. 2
0
 private void SetRepositories()
 {
     AssetSettings                = new AssetSettingRepository(_context);
     AssetRelationships           = new AssetRelationshipRepository(_context);
     Assets                       = new AssetRepository(_context);
     AssetTransactions            = new AssetTransactionRepository(_context);
     AssetTypeSettingTypes        = new AssetTypeSettingTypeRepository(_context);
     AssetTypeRelationshipTypes   = new AssetTypeRelationshipTypeRepository(_context);
     AssetTypes                   = new AssetTypeRepository(_context);
     ParentChildRelationshipTypes = new ParentChildRelationshipTypeRepository(_context);
     RelationshipTypes            = new RelationshipTypeRepository(_context);
     SettingTypes                 = new SettingTypeRepository(_context);
     TransactionCategories        = new TransactionCategoryRepository(_context);
     TransactionDescriptions      = new TransactionDescriptionRepository(_context);
     TransactionTypes             = new TransactionTypeRepository(_context);
 }