Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
tatarincev committed Jul 1, 2016
2 parents 1579066 + 34506e4 commit 99856d3
Show file tree
Hide file tree
Showing 10 changed files with 540 additions and 435 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="VirtoCommerce.Domain, Version=2.11.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\VirtoCommerce.Domain.2.11.0\lib\net451\VirtoCommerce.Domain.dll</HintPath>
<Reference Include="VirtoCommerce.Domain, Version=2.14.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\VirtoCommerce.Domain.2.14.1\lib\net451\VirtoCommerce.Domain.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="VirtoCommerce.Platform.Core, Version=2.11.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\VirtoCommerce.Platform.Core.2.11.0\lib\net451\VirtoCommerce.Platform.Core.dll</HintPath>
<Reference Include="VirtoCommerce.Platform.Core, Version=2.11.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\VirtoCommerce.Platform.Core.2.11.2\lib\net451\VirtoCommerce.Platform.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="VirtoCommerce.Platform.Data, Version=2.11.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\VirtoCommerce.Platform.Data.2.11.0\lib\net451\VirtoCommerce.Platform.Data.dll</HintPath>
<Reference Include="VirtoCommerce.Platform.Data, Version=2.11.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\VirtoCommerce.Platform.Data.2.11.2\lib\net451\VirtoCommerce.Platform.Data.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions VirtoCommerce.OrderModule.Data/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<package id="EntityFramework" version="6.1.1" targetFramework="net451" />
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net451" />
<package id="valueinjecter" version="2.3.3" targetFramework="net451" />
<package id="VirtoCommerce.Domain" version="2.11.0" targetFramework="net451" />
<package id="VirtoCommerce.Platform.Core" version="2.11.0" targetFramework="net451" />
<package id="VirtoCommerce.Platform.Data" version="2.11.0" targetFramework="net451" />
<package id="VirtoCommerce.Domain" version="2.14.1" targetFramework="net451" />
<package id="VirtoCommerce.Platform.Core" version="2.11.2" targetFramework="net451" />
<package id="VirtoCommerce.Platform.Data" version="2.11.2" targetFramework="net451" />
</packages>
7 changes: 1 addition & 6 deletions VirtoCommerce.OrderModule.Test/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@
<!-- VC integration-->
<add name="VirtoCommerce" connectionString="Data Source=MC103\SQLEXPRESS;Initial Catalog=VirtoCommerce2;Persist Security Info=True;User ID=virto;Password=virto;MultipleActiveResultSets=True;Connect Timeout=420" providerName="System.Data.SqlClient" />

<!-- Elastic Search -->
<add name="SearchConnectionString" connectionString="server=localhost:9200;scope=default;provider=elasticsearch" />
<!-- LUCENE -->
<!--<add name="SearchConnectionString" connectionString="server=~/app_data/virto/search;scope=default;provider=lucene" />-->

<!-- Asset Connection Strings -->
<add name="AssetsConnectionString" connectionString="DefaultEndpointsProtocol=http;AccountName=virtotest;AccountKey=Qv2BT4FD87eSx94MrBUcURw9YbrZ8tsmB9WnOIv1Vgdc9t2ur397qAKUsHokJ96w5F21lFS3c6OG54jjTaZ5Dw==" />
<add name="VirtoCommerce_MigrationTestsBase" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog={0};Integrated Security=SSPI" providerName="System.Data.SqlClient" />
</connectionStrings>

<entityFramework>
Expand Down
36 changes: 36 additions & 0 deletions VirtoCommerce.OrderModule.Test/MigrationScenarios.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Linq;
using VirtoCommerce.OrderModule.Data.Repositories;
using VirtoCommerce.Platform.Testing.Bases;
using VirtoCommerce.OrderModule.Data.Migrations;
using Xunit;
using VirtoCommerce.Platform.Data.Infrastructure;

namespace VirtoCommerce.OrderModule.Test
{
public class MigrationScenarios : MigrationsTestBase
{
[Fact]
[Trait("Category", "CI")]
public void Can_create_order_new_database()
{
DropDatabase();

var migrator = CreateMigrator<Configuration>();

using (var context = CreateContext<OrderRepositoryImpl>())
{
context.Database.CreateIfNotExists();
new SetupDatabaseInitializer<OrderRepositoryImpl, Configuration>().InitializeDatabase(context);
Assert.Equal(0, context.CustomerOrders.Count());
}

// remove all migrations
migrator.Update("0");
Assert.False(TableExists("OrderLineItem"));
var existTables = Info.Tables.Any();
Assert.False(existTables);

DropDatabase();
}
}
}
Loading

0 comments on commit 99856d3

Please sign in to comment.