public static MentoringPlatformSecurityContext GetTestContextWithData() { var options = new DbContextOptionsBuilder <MentoringPlatformSecurityContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()) .Options; var dbContext = new MentoringPlatformSecurityContext(options); dbContext.Users.Add(new User { Id = 1, FirstName = "Leshan", LastName = "Wijegunawardana", Email = "*****@*****.**", Password = "******", Designation = "Software Engineer", UserRoleId = 1 }); dbContext.Users.Add(new User { Id = 2, FirstName = "Dhanika", LastName = "Munasinghe", Email = "*****@*****.**", Password = "******", Designation = "Software Engineer", UserRoleId = 1 }); dbContext.Users.Add(new User { Id = 3, FirstName = "Thusitha", LastName = "Wijerathne", Email = "*****@*****.**", Password = "******", Designation = "Software Engineer", UserRoleId = 1 }); dbContext.Users.Add(new User { Id = 4, FirstName = "Mark", LastName = "Sinnathambi", Email = "*****@*****.**", Password = "******", Designation = "Tech Lead", UserRoleId = 2 }); dbContext.UserRoles.Add(new UserRole { Id = 1, UserRoleName = "mentee" }); dbContext.UserRoles.Add(new UserRole { Id = 2, UserRoleName = "mentor" }); return(dbContext); }
public UserRepository(MentoringPlatformSecurityContext dbContext) : base(dbContext) { }