Esempio n. 1
0
        public void UpdateUserTest()
        {
            var builder = new DbContextOptionsBuilder <SQLDBContext>();

            builder.UseInMemoryDatabase();
            var options = builder.Options;

            using (var context = new SQLDBContext(options))
            {
                var userManager = new TigerSpikeLandMarks.Managers.UserManager.UserManager(context, mockDataRepo.Object);;
                var allUsers    = userManager.Create(new User {
                    Id = 2, Username = "******", FirstName = "firstName2", LastName = "lastname2", PasswordHash = new byte[] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }, PasswordSalt = new byte[] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20 }
                }, "password");
                context.SaveChanges();
            }

            using (var context = new SQLDBContext(options))
            {
                var userManager = new TigerSpikeLandMarks.Managers.UserManager.UserManager(context, mockDataRepo.Object);;
                var user        = userManager.GetById(1);
                user.FirstName = "updated";
                context.SaveChanges();
            }

            using (var context = new SQLDBContext(options))
            {
                var userManager = new TigerSpikeLandMarks.Managers.UserManager.UserManager(context, mockDataRepo.Object);;
                var user        = userManager.GetById(1);
                Assert.IsTrue("updated" == user.FirstName);
            }
        }
Esempio n. 2
0
        public void Test1()
        {
            IDBContext             context = new SQLDBContext();
            RawMaterialItemManager item    = new RawMaterialItemManager(context);

            item.UpdateItem(4);

            RawMaterialItem rawMaterialItem = context.SearchRawMaterialItems(4);

            //Assert.True(Math.Round(rawMaterialItem.CostPerUnit, 2) == 0.29);
            //Assert.True(Math.Round(rawMaterialItem.LandedCostPerUnit, 2) == 0.43);
        }
        public FileManagerController(SQLDBContext context, IConfiguration config)
        {
            var provider = config.GetValue <string>("FileManager");

            switch (provider)
            {
            case "google":
                fileManager = new GoogleFileManager(config);
                break;

            case "local":
                fileManager = new LocalFileManager();
                break;
            }
        }
Esempio n. 4
0
 public MitigationEmissionsDataController(SQLDBContext context)
 {
     _context = context;
 }
Esempio n. 5
0
 public QuestionsController(SQLDBContext context)
 {
     _context = context;
 }
 public AdHocController(SQLDBContext context)
 {
     _context = context;
 }
Esempio n. 7
0
 public LookupsController(SQLDBContext context)
 {
     _context = context;
 }
 public CDMStatusController(SQLDBContext context)
 {
     _context = context;
 }
 public TargetAudienceController(SQLDBContext context)
 {
     _context = context;
 }
Esempio n. 10
0
 public ProductRepository(SQLDBContext context)
 {
     _context = context;
 }
Esempio n. 11
0
 public DataRepository(SQLDBContext dbContext)
 {
     _dbContext = dbContext;
 }
Esempio n. 12
0
 public FundersController(SQLDBContext context)
 {
     _context = context;
 }
 public MitigationDetailsController(SQLDBContext context)
 {
     _context = context;
 }
Esempio n. 14
0
 public AvatarTypeRepo(SQLDBContext context)
 {
     _context = context;
 }
 public GolfCardRepository()
 {
     _sqlConnect = new SQLDBContext();
 }
Esempio n. 16
0
 public VoluntaryGoldStandardController(SQLDBContext context)
 {
     _context = context;
 }
 public HazardsController(SQLDBContext context)
 {
     _context = context;
 }
Esempio n. 18
0
 public GoalsController(SQLDBContext context, IConfiguration config)
 {
     _context = context;
     _config  = config;
 }
 public ProjectsController(SQLDBContext context, IConfiguration config)
 {
     _context = context;
     _config  = config;
 }
Esempio n. 20
0
 public DBRepository()
 {
     _db = new SQLDBContext();
 }
Esempio n. 21
0
 public AdaptationPurposeController(SQLDBContext context)
 {
     _context = context;
 }
 public ProjectTypeController(SQLDBContext context)
 {
     _context = context;
 }
Esempio n. 23
0
 public TypologyController(SQLDBContext context)
 {
     _context = context;
 }
 public SAGovDeptsController(SQLDBContext context)
 {
     _context = context;
 }
 public ProjectStatusController(SQLDBContext context)
 {
     _context = context;
 }
Esempio n. 26
0
        public IDBContext <T> GetContext <T>() where T : BaseEntity <T>, new()
        {
            IDBContext <T> context = new SQLDBContext <T>(_currentSessionMgr.GetCurrentSession());

            return(context);
        }
 public CarbonCreditMarketController(SQLDBContext context)
 {
     _context = context;
 }
Esempio n. 28
0
 public UserManager(SQLDBContext context, IDataRepository dataRepository)
 {
     _context        = context;
     _dataRepository = dataRepository;
 }
Esempio n. 29
0
 public VoluntaryMethodologyController(SQLDBContext context)
 {
     _context = context;
 }
 public TeeRepository()
 {
     _sqlConnect = new SQLDBContext();
 }