public void ValidRegisterShouldCreateNewUser() { var options = new DbContextOptionsBuilder <ObiectiveDbContext>() .UseInMemoryDatabase(databaseName: nameof(ValidRegisterShouldCreateNewUser))// "ValidRegisterShouldCreateANewUser") .Options; using (var context = new ObiectiveDbContext(options)) { var usersService = new UsersService(context, config); var added = new Lab3.ViewModels.RegisterPostModel { Email = "*****@*****.**", FirstName = "firstName1", LastName = "lastName1", UserName = "******", Password = "******" }; var result = usersService.Register(added); Assert.IsNotNull(result); Assert.AreEqual(added.UserName, result.UserName); } }
public ObiectivService(ObiectiveDbContext context) { this.context = context; }
public CommentService(ObiectiveDbContext context) { this.context = context; }
public ObiectiveController(ObiectiveDbContext context) { this.context = context; }
public UsersService(ObiectiveDbContext context, IOptions <AppSettings> appSettings) { this.context = context; this.appSettings = appSettings.Value; }