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); } }
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; } }
public MitigationEmissionsDataController(SQLDBContext context) { _context = context; }
public QuestionsController(SQLDBContext context) { _context = context; }
public AdHocController(SQLDBContext context) { _context = context; }
public LookupsController(SQLDBContext context) { _context = context; }
public CDMStatusController(SQLDBContext context) { _context = context; }
public TargetAudienceController(SQLDBContext context) { _context = context; }
public ProductRepository(SQLDBContext context) { _context = context; }
public DataRepository(SQLDBContext dbContext) { _dbContext = dbContext; }
public FundersController(SQLDBContext context) { _context = context; }
public MitigationDetailsController(SQLDBContext context) { _context = context; }
public AvatarTypeRepo(SQLDBContext context) { _context = context; }
public GolfCardRepository() { _sqlConnect = new SQLDBContext(); }
public VoluntaryGoldStandardController(SQLDBContext context) { _context = context; }
public HazardsController(SQLDBContext context) { _context = context; }
public GoalsController(SQLDBContext context, IConfiguration config) { _context = context; _config = config; }
public ProjectsController(SQLDBContext context, IConfiguration config) { _context = context; _config = config; }
public DBRepository() { _db = new SQLDBContext(); }
public AdaptationPurposeController(SQLDBContext context) { _context = context; }
public ProjectTypeController(SQLDBContext context) { _context = context; }
public TypologyController(SQLDBContext context) { _context = context; }
public SAGovDeptsController(SQLDBContext context) { _context = context; }
public ProjectStatusController(SQLDBContext context) { _context = context; }
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; }
public UserManager(SQLDBContext context, IDataRepository dataRepository) { _context = context; _dataRepository = dataRepository; }
public VoluntaryMethodologyController(SQLDBContext context) { _context = context; }
public TeeRepository() { _sqlConnect = new SQLDBContext(); }