5
Crost
5y

Just spent 3 fucking hours trying to find out why my tests are failing. I'm mocking ef with an in memory sqlite dB as THE FUCKING. Net docs say to.

My code does a simple decimal comparison in a linq statement and returns bullshit. Why? Sqlite does not have a decimal type, it does some sort of BULLSHIT to convert it into some sort of text value.

I change all my models to use doubles instead of decimals and all my tests turn green.

WTF IS THIS SHIT. If it doesn't work don't tell me to use it. I expect better of the. Net docs. Wtf are they doing.

Comments
  • 1
    Been there :/ LINQ+EF is a leaky abstraction at times... Here's this thing that is awesome, don't worry about the rest - oh wait. I still think LINQ is awesome though...

    edit: I think I wrote a query with a date comparison in it and the comparison couldn't be translated to SQL
  • 1
    My code does a datetime offset comparison that works but I've seen a lot of people say stuff like that on stackoverflow.

    I guess I'll have to use the default in memory dB to test this stuff then, but it's not relational so it won't actually perform the same.. Dunno how that is supposed to work when a ef app obviously uses relations heavily. I have no idea what you're supposed to do and how in 2018 this can be a problem on their main docs.
  • 2
    Quick update

    It turns out I'm the idiot. Makes sense.

    Standard in memory is fine for testing, it doesn't enforce constraints but that's fine since it's not the dB under test.

    I have wasted many hours of my life
Add Comment