JonPSmith / EfCore.TestSupport

Tools for helping in unit testing applications that use Entity Framework Core
https://www.thereformedprogrammer.net/new-features-for-unit-testing-your-entity-framework-core-5-code/
Other
352 stars 53 forks source link

Logs output behavior #10

Closed juchom closed 5 years ago

juchom commented 5 years ago

I'm not sure if this is an issue or this is the way you want it to show logs result.

STEP 1:

You run the comparer and you have this logs in error: EXTRA IN DATABASE: ht->Table 'Address' EXTRA IN DATABASE: ht->Table 'Customers' EXTRA IN DATABASE: ht->Table 'Employees'

STEP 2:

Here are the logs: DIFFERENT: Address->Property 'Address1', column type. Expected = nvarchar(max), found = nvarchar(200)

I would have expected something like: EXTRA IN DATABASE: ht->Table 'Customers' EXTRA IN DATABASE: ht->Table 'Employees' DIFFERENT: Address->Property 'Address1', column type. Expected = nvarchar(max), found = nvarchar(200)

JonPSmith commented 5 years ago

Hi @juchom,

The schema compare runs in two stages:

  1. Stage1: checks for differences in matching tables
  2. Stage2: checks for EXTRA/MISSING tables/indexes etc.

If stage1 fails, then I don't run stage2. My reasoning was if there were errors in you existing tables I shouldn't run the second stage because the second stage can't be sure the existing tables are an exact match to the tables you have.

juchom commented 5 years ago

Ok I thought it was working the other way.

First checking at the tables/entities level, then foreach tables/entities check differences!

That's why I was a bit surprised! Thanks for your quick reply!