When Testing DateTime With SQL == Broken

  Рет қаралды 268

Jeff Zuerlein

Jeff Zuerlein

Күн бұрын

Пікірлер: 5
@awright18
@awright18 10 ай бұрын
Great idea🎉🎉!
@JeffZuerlein
@JeffZuerlein 10 ай бұрын
Thank you! 😊
@nickcodes5430
@nickcodes5430 10 ай бұрын
Hi. Cool code. This is not relevant to the topic but since there are no arguments in the DateTime constructor (DateTime expected = new DateTime();) expected variable data is set to the default value making your Assert always to fail . Assert.That.SqlDatesAreEqual(result.Accepted.Value, expected); How are you getting data into "expected " variable? Thanks
@JeffZuerlein
@JeffZuerlein 10 ай бұрын
This is why I shouldn't post things on the internet while I'm going on a rant. :^) I fiddled with a real test to put the focus on the DateTime comparison. Normally what I do is to have properties in the test class to represent the expected values. An initialization function uses AutoFixture to populate those expected values and put them in the DB. That way when I test the repository's get method, I have something to compare the results to.
@nickcodes5430
@nickcodes5430 10 ай бұрын
@@JeffZuerlein Ah, that makes sense! Thank you, Sir!
Boost Performance By Sorting With Span of T
9:41
Jeff Zuerlein
Рет қаралды 513
Span of T vs. Memory of T
9:44
Jeff Zuerlein
Рет қаралды 7 М.
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 42 МЛН
Сестра обхитрила!
00:17
Victoria Portfolio
Рет қаралды 958 М.
T-SQL Skills: Loading Millions Of Rows Of Test Data In Seconds
11:19
Manage User Rights By Decorating Their Claims Identity
9:35
Jeff Zuerlein
Рет қаралды 3 М.
Entity Based Authorization: When Roles Are Not Enough...
11:16
Jeff Zuerlein
Рет қаралды 748
Threads 7 - Background Worker
16:18
C# Artisan
Рет қаралды 38
Avoid Deadlocks
4:10
Jeff Zuerlein
Рет қаралды 3 М.
Do Less And Accomplish More With Unit Testing
13:15
Jeff Zuerlein
Рет қаралды 239
Avoid Premature Optimization By Generating Test Data
11:33
Jeff Zuerlein
Рет қаралды 177
Deep Dive On Authorization Handlers
10:33
Jeff Zuerlein
Рет қаралды 238
Unit Testing Authorization Handlers And Policies
10:58
Jeff Zuerlein
Рет қаралды 211
Supercharged Dapper Repositories Part #4 Grid Readers
7:54
Jeff Zuerlein
Рет қаралды 228
Tuna 🍣 ​⁠@patrickzeinali ​⁠@ChefRush
00:48
albert_cancook
Рет қаралды 148 МЛН