Skip to content

Commit

Permalink
Updates for tests and based on review comments. Some InProcTests stil…
Browse files Browse the repository at this point in the history
…l failing for vNext.

(cherry picked from commit a3b99ea)
  • Loading branch information
lajones committed Jun 24, 2014
1 parent 0529da4 commit bc291f7
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,11 @@ public static string CreateDefaultLocalDbConnectionString(string initialCatalog)
return
string.Format(
CultureInfo.InvariantCulture,
#if VS14
@"Data Source=(LocalDb)\MSSQLLocalDB;Initial Catalog={0};Integrated Security=True",
#else
@"Data Source=(LocalDb)\v11.0;Initial Catalog={0};Integrated Security=True",
#endif
initialCatalog);
}

Expand Down
2 changes: 1 addition & 1 deletion src/EFTools/XmlCore/Model/EFArtifact.cs
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ internal class ChangeProcessingFailedException : Exception
}

/// <summary>
/// Returns the XObject for the given line & column number.
/// Returns the XObject for the given line &amp; column number.
/// </summary>
internal XObject FindXObjectForLineAndColumn(int lineNumber, int columnNumber)
{
Expand Down
2 changes: 1 addition & 1 deletion src/EFTools/XmlCore/Model/EFArtifactSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Microsoft.Data.Entity.Design.Model

/// <summary>
/// This class represents a set of artifacts that are validated and resolved with respect to one another.
/// This class contains resolve information (symbols & bindings) and dep & anti-dep info
/// This class contains resolve information (symbols &amp; bindings) and dep &amp; anti-dep info
/// </summary>
internal abstract class EFArtifactSet
{
Expand Down
6 changes: 3 additions & 3 deletions src/EntityFramework/Utilities/DbProviderServicesExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ public static string GetProviderManifestTokenChecked(
}
catch (ProviderIncompatibleException ex)
{
if ("(localdb)\v11.0".Equals(
DbInterception.Dispatch.Connection.GetDataSource(connection, new DbInterceptionContext()),
StringComparison.OrdinalIgnoreCase))
var dataSource = DbInterception.Dispatch.Connection.GetDataSource(connection, new DbInterceptionContext());
if (@"(localdb)\v11.0".Equals(dataSource, StringComparison.OrdinalIgnoreCase)
|| @"(localdb)\mssqllocaldb".Equals(dataSource, StringComparison.OrdinalIgnoreCase))
{
throw new ProviderIncompatibleException(Strings.BadLocalDBDatabaseName, ex);
}
Expand Down
4 changes: 4 additions & 0 deletions test/EFTools/E2ETests/DBInitialize.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ public class MyConf : DbConfiguration
{
public MyConf()
{
#if VS14
SetDefaultConnectionFactory(new LocalDbConnectionFactory("mssqllocaldb"));
#else
SetDefaultConnectionFactory(new LocalDbConnectionFactory("v11.0"));
#endif
this.SetDatabaseInitializer<SchoolEntities>(new Initializer1());
}
}
Expand Down
8 changes: 8 additions & 0 deletions test/EFTools/E2ETests/WhiteE2ETests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,11 @@ public void AddModelFromDBUpdateModel()
"Title CHAR(50) NOT NULL, Author CHAR(50), " +
"PageCount INTEGER, Topic CHAR(30), Code CHAR(15))";

#if VS14
const string connectionString = @"Data Source=(localdb)\mssqllocaldb;initial catalog=School;integrated security=True;Pooling=false";
#else
const string connectionString = @"Data Source=(localdb)\v11.0;initial catalog=School;integrated security=True;Pooling=false";
#endif
ExecuteSqlCommand(connectionString, createTable);

// Update model from db
Expand Down Expand Up @@ -912,7 +916,11 @@ private void HandleConnectionDialog(string dbName)
var serverNameText = _wizard.Get<TextBox>(
SearchCriteria.ByText(
_resourceHelper.GetConnectionUIDialogResourceString("serverLabel.Text")));
#if VS14
serverNameText.Enter(@"(localdb)\mssqllocaldb");
#else
serverNameText.Enter(@"(localdb)\v11.0");
#endif

var refreshButton = _wizard.Get<Button>(
SearchCriteria.ByText(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,19 @@ public void OnDeactivate_updates_model_settings_if_model_file_does_not_exist_for
public void OnDeactivate_updates_model_settings_if_model_file_does_not_exist_for_CodeFirst_empty_model()
{
var configXml = new XmlDocument();
configXml.LoadXml(@"<configuration>
<connectionStrings>
<add name=""myModel"" connectionString=""Data Source=(localdb)\v11.0;"" providerName=""System.Data.SqlClient"" />
configXml.LoadXml(
string.Format(System.Globalization.CultureInfo.CurrentCulture,
@"<configuration>
<connectionStrings>
<add name=""myModel"" connectionString=""Data Source=(localdb)\{0};"" providerName=""System.Data.SqlClient"" />
</connectionStrings>
</configuration>");
</configuration>",
#if VS14
"MSSQLLocalDB"
#else
"v11.0"
#endif
));

var mockConfig = new Mock<ConfigFileUtils>(Mock.Of<Project>(), Mock.Of<IServiceProvider>(), null, Mock.Of<IVsUtils>(), null);
mockConfig.Setup(u => u.LoadConfig()).Returns(configXml);
Expand All @@ -201,7 +209,11 @@ public void OnDeactivate_updates_model_settings_if_model_file_does_not_exist_for
Assert.Equal(@"myModel1", modelBuilderSettings.AppConfigConnectionPropertyName);
Assert.True(modelBuilderSettings.SaveConnectionStringInAppConfig);
Assert.Equal(
#if VS14
@"Data Source=(LocalDb)\MSSQLLocalDB;Initial Catalog=modelNamespace.myModel;Integrated Security=True",
#else
@"Data Source=(LocalDb)\v11.0;Initial Catalog=modelNamespace.myModel;Integrated Security=True",
#endif
modelBuilderSettings.AppConfigConnectionString);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,11 @@ public void GetUniqueConnectionStringName_uniquifies_proposed_connection_string_
public void CreateDefaultLocalDbConnectionString_returns_correct_default_connection_string()
{
Assert.Equal(
#if VS14
@"Data Source=(LocalDb)\MSSQLLocalDB;Initial Catalog=App.MyContext;Integrated Security=True",
#else
@"Data Source=(LocalDb)\v11.0;Initial Catalog=App.MyContext;Integrated Security=True",
#endif
ConnectionManager.CreateDefaultLocalDbConnectionString("App.MyContext"));
}

Expand Down
2 changes: 1 addition & 1 deletion tools/EntityFramework.targets
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Project global post-settings and targets.
<PropertyGroup Condition="'$(BuildingToolingProject)' == 'true'">
<WixFullProductName_Dev11>Entity Framework $(RuntimeVersionMajor).$(RuntimeVersionMinor).$(VersionReleasePrefix) Tools $(VersionReleaseName) for Visual Studio 2012</WixFullProductName_Dev11>
<WixFullProductName_Dev12>Entity Framework $(RuntimeVersionMajor).$(RuntimeVersionMinor).$(VersionReleasePrefix) Tools $(VersionReleaseName) for Visual Studio 2013</WixFullProductName_Dev12>
<WixFullProductName_Dev14>Entity Framework $(RuntimeVersionMajor).$(RuntimeVersionMinor).$(VersionReleasePrefix) Tools $(VersionReleaseName) for Visual Studio 2014</WixFullProductName_Dev14>
<WixFullProductName_Dev14>Entity Framework $(RuntimeVersionMajor).$(RuntimeVersionMinor).$(VersionReleasePrefix) Tools $(VersionReleaseName) for Visual Studio 14</WixFullProductName_Dev14>
<WixProductDescription_Dev11>$(WixFullProductName_Dev11)</WixProductDescription_Dev11>
<WixProductDescription_Dev12>$(WixFullProductName_Dev12)</WixProductDescription_Dev12>
<WixProductDescription_Dev14>$(WixFullProductName_Dev14)</WixProductDescription_Dev14>
Expand Down
2 changes: 1 addition & 1 deletion tools/VsIdeHostAdapter/Installer/Defines.wxi
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<?elseif $(var.VisualStudioVersion) = 14.0?>
<?define ProductId = {6FDF32A2-AC01-477f-A9DF-738BC836EE53}?>
<?define UpgradeCode = {BEBFDF8D-1831-4610-B0F4-9BA05E7C60DF}?>
<?define FullProductName = VS IDE Test Host for Visual Studio 2014?>
<?define FullProductName = VS IDE Test Host for Visual Studio 14?>
<?define ProductDescription = Allows to run tests inside VS IDE?>
<?define ProductVersion = $(var.WixVsIDETestHostAdapterProductVersion)?>
<?endif?>
Expand Down

0 comments on commit bc291f7

Please sign in to comment.