public void Base_connection_string_on_dev_box_with_SQL_Express_installed_has_SQL_Express_connection_string() { using (var detector = new SqlServerDetector(Registry.LocalMachine, new ServiceControllerProxy(new ServiceController("MSSQL$SQLEXPRESS")))) { var specification = detector.BuildConnectionFactorySpecification(); Assert.Equal(ConnectionFactorySpecification.SqlConnectionFactoryName, specification.ConnectionFactoryName); Assert.Empty(specification.ConstructorArguments); } }
public void SqlServerDetector_detects_LocalDB_v11_0_on_dev_machine() { using (var detector = new SqlServerDetector(Registry.LocalMachine, new Mock<ServiceControllerProxy>().Object)) { Assert.Equal("11.0", detector.TryGetLocalDBVersionInstalled()); } }
public void SqlServerDetector_detects_SQL_Express_on_dev_machine() { using (var detector = new SqlServerDetector(new Mock<RegistryKeyProxy>().Object, new ServiceControllerProxy(new ServiceController("MSSQL$SQLEXPRESS")))) { Assert.True(detector.IsSqlExpressInstalled()); } }
public void SqlServerDetector_generates_LocalDB_11_base_connection_string_if_neither_LocalDB_or_Express_are_installed() { var specification = new SqlServerDetector(CreatedMockedRegistryKey(new string[0]), CreateMockedController(status: null)) .BuildConnectionFactorySpecification(); Assert.Equal(ConnectionFactorySpecification.LocalDbConnectionFactoryName, specification.ConnectionFactoryName); Assert.Equal("v11.0", specification.ConstructorArguments.Single()); }
public void SqlServerDetector_generates_LocalDB_base_connection_string_if_LocalDB_is_installed_and_Express_is_not() { var specification = new SqlServerDetector(CreatedMockedRegistryKey("12.0"), CreateMockedController(status: null)) .BuildConnectionFactorySpecification(); Assert.Equal(ConnectionFactorySpecification.LocalDbConnectionFactoryName, specification.ConnectionFactoryName); Assert.Equal("v12.0", specification.ConstructorArguments.Single()); }
public void SqlServerDetector_generates_SQL_Express_base_connection_string_if_Express_is_installed_and_LocalDB_is_not() { var specification = new SqlServerDetector(CreatedMockedRegistryKey(new string[0]), CreateMockedController()) .BuildConnectionFactorySpecification(); Assert.Equal(ConnectionFactorySpecification.SqlConnectionFactoryName, specification.ConnectionFactoryName); Assert.Empty(specification.ConstructorArguments); }