Archiwa tagu: SQL Server CE

SpecFlow, Entity Framework i SQL Server CE

TL;DR

  1. Zainstaluj SQL Server CE 4.0
  2. Dodaj projekt testowy (wersja .NET 4.0 lub wyższy)
  3. Dodaj do projektu testowego referencje do projektu z modelem
  4. Dodaj do projektu testowego nugetem pakiety:
    1. SpecFlow.xUnit (wersja 2.0)
    2. xunit.runner.visualstudio (wersja 2.1)
    3. EntityFramework.SqlServerCompact (wersja 6.1.3)
  5. W App.config dodaj odpowiedni ConnectionString, np.
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
     <connectionStrings>
       <add name="DefaultConnection" connectionString="Data Source=d:\test.sdf;Persist Security Info=False;" providerName="System.Data.SqlServerCe.4.0"/>
     </connectionStrings>
    </configuration>
  6. Do projektu dodaj nowy plik z szablonu „SpecFlow Feature File” i napisz scenariusze
  7. Wygeneruj klasę dla kroków scenariuszy i oprogramuj je

c.d.n.