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);
            }
        }
Example #2
0
 public ObiectivService(ObiectiveDbContext context)
 {
     this.context = context;
 }
Example #3
0
 public CommentService(ObiectiveDbContext context)
 {
     this.context = context;
 }
 public ObiectiveController(ObiectiveDbContext context)
 {
     this.context = context;
 }
Example #5
0
 public UsersService(ObiectiveDbContext context, IOptions <AppSettings> appSettings)
 {
     this.context     = context;
     this.appSettings = appSettings.Value;
 }