skmkqw
How to delete a cross-domain cookie
Hey, I'm working on a web app (next.js as a frontend and .net api as backend). I decided to try cross-domain cookies to make authentication more simple. it works, i can log in or register, but when im trying to clear the cookie on logout the problem comes. i tried to do this on a frontend initially, but then i found out that i could only be done on the "main" domain. Logout endpoint returns "Ok" but i still can see a cookie in browser. here's how i set and delete cookies how to make it work?
1 replies
Can't style NavLink in Blazor
I've been trying to create a frontend part of my application. My sidebar contained div's representing each page section. Recently i found out that using NavLinks is more correct in Blazor. Navigation itself works as expected, but no styles are applied to NavLinks. I've tried to style it in different ways, but none of them helped. adding styles to .element-style in chrome devtools works, so it looks like i'm referencing navlinks in a wrong way. See Layout branch -> ProjectPulse.Web->Components->Layout->Sidebar.razor https://github.com/skmkqw/ProjectPulseApp/tree/Layout
1 replies
Cant create seed data for integrational tests
Hello evereybody. I've recently updated my projects with authentification. Before that, i managed users as simple database resource with simple CRUD operations. Now my AppUser inherits from IdentityUser. I also added a new endpoint for user registration. But now i need to update my integrational tests and im having problems with inserting seed data into test database. How to fix my WebApplicationFactory and Utilites classes to add/delete seede users to database?
12 replies
Problem with seeding data
Hello evereybody. I've recently updated my projects with authentification. Before that, i managed users as simple database resource with simple CRUD operations. Now my AppUser inherits from IdentityUser. I also added a new endpoint for user registration. But now i need to update my integrational tests and im having problems with inserting seed data into test database. How to fix my WebApplicationFactory and Utilites classes to add/delete seede users to database?
1 replies
Integrational testing and authentification
Hello evereybody. I've recently updated my projects with authentification. Before that, i managed users as simple database resource with simple CRUD operations. Now my AppUser inherits from IdentityUser. I also added a new endpoint for user registration. But now i need to update my integrational tests and im having problems with inserting seed data into test database. How to fix my WebApplicationFactory and Utilites classes to add/delete seede users to database?
1 replies
Is my unit testing approach correct?
Hello everybody, i'm getting into backend development in asp.net core and ef. i've already built a simple API, but it has an overkill architecure (made this in educational purposes). Now I'm trying to cover the whole project in unit tests. Since I use dbContext -> repository -> service -> controller pattern, i came up with an idea on how to test it: while testing the controller, i will create a mock service, while testing the service, i will create a mock repository, while testing the repository, I will create a fixture database with an example dataset. Does this make sense? You can see my latest code here https://github.com/skmkqw/ProjectManagementAPI at "unitTests" branch. I also hear of something called FluentAssertions. Should i user it from the beggining or should i introduce it later when I will get used to writing tests in regular xUnit?
13 replies