Closed micahlee closed 7 years ago
This looks great and thanks for adding the tests. On my machine, I had to copy the connection strings from web.config to app.config for it to work. What is the best way to reference the connection strings from the Unit Test?
@bikeoid Yeah, it looks like it was just defaulting to a LocalDB instance on my machine when running the unit tests without a connection string set in the app.config. Copying the connection strings to match the web app is probably the right solution for pointing it to the actual DB.
This is to begin resolving #29.
I updated the way the queries are structured in
GetRolesForUser
,GetUsersInRole
, andFindUsersInRole
to make the number of db queries constant, rather than growing with the number of users and roles involved. I also added a couple of additional unit tests to verify this.There's probably more that can be done here. Particularly the Add and Remove methods will scale even more poorly since there is so much getting queried in the tight loop, but I'm guessing these don't get called enough to cause an issue.