StartTestServer() 공개 정적인 메소드

public static StartTestServer ( bool enableFedAuth = false ) : TestTdsServer
enableFedAuth bool
리턴 TestTdsServer
예제 #1
0
 public void ConnectionTest()
 {
     using (TestTdsServer server = TestTdsServer.StartTestServer())
     {
         using (SqlConnection connection = new SqlConnection(server.ConnectionString))
         {
             connection.Open();
         }
     }
 }
예제 #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();
         }
     }
 }
예제 #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);
        }