StartTestServer() public static method

public static StartTestServer ( bool enableFedAuth = false ) : TestTdsServer
enableFedAuth bool
return TestTdsServer
Ejemplo n.º 1
0
 public void ConnectionTest()
 {
     using (TestTdsServer server = TestTdsServer.StartTestServer())
     {
         using (SqlConnection connection = new SqlConnection(server.ConnectionString))
         {
             connection.Open();
         }
     }
 }
Ejemplo n.º 2
0
 [ConditionalFact(nameof(PlatformDetection) + "." + nameof(PlatformDetection.IsNotWindowsNanoServer))] // https://github.com/dotnet/corefx/issues/19218
 public void IntegratedAuthConnectionTest()
 {
     using (TestTdsServer server = TestTdsServer.StartTestServer())
     {
         SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder(server.ConnectionString);
         builder.IntegratedSecurity = true;
         using (SqlConnection connection = new SqlConnection(builder.ConnectionString))
         {
             connection.Open();
         }
     }
 }
Ejemplo n.º 3
0
        public void ConnectionTest()
        {
            Exception e = null;

            using (TestTdsServer server = TestTdsServer.StartTestServer())
            {
                try
                {
                    SqlConnection connection = new SqlConnection(server.ConnectionString);
                    connection.Open();
                }
                catch (Exception ce)
                {
                    e = ce;
                }
            }
            Assert.Null(e);
        }