Technology

TGIMBA .NET Core API – The New API and Service Layers – Part 2 – User Methods

Git  Code Commit (all commits between last post and this commit (link))

So to continue The Globe In My BucketList Application (TGIMBA) Application Programmatic Interface (API)/Service post series, part 2 is the user methods – ProcessUser(args) and ProcessUserRegistration(args).

1

ProcessUser(args) handles logging a user in by returning a token that lasts for a period of time.

1

ProcessUserRegistration(args) registers a new user and returns true or false depending on if the registration is successful.

1

The basic process for each method from the previous version didn’t change a lot, but this time I added tests 🙂

1

Highlights

  • Something I have not done before with MS Test is running one test with multiple versions of the parameters. I had seen this in xUnit as a ‘Theory’.  Some digging revealed the MS Test eqivalent is to use the ‘[DataTestMethod]’ decorator.

1

  • Get Salt – Found an upgrade (I think) to the previous implementation I used.  Namely ‘saltGen.GetNonZeroBytes(buffer);’.

1

The next and final post of the API/Service upgrade will the bucket list related ones.

Stay tuned!

References

  1. https://stackoverflow.com/questions/6415724/best-way-to-generate-random-salt-in-c

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s