Skip to content

Commit a906865

Browse files
NO-SNOW Switch to LF endings (#1274)
1 parent 0b0406d commit a906865

36 files changed

+8488
-8465
lines changed

.EditorConfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ indent_size = 4
66
insert_final_newline = true
77
trim_trailing_whitespace = true
88
charset = utf-8
9+
end_of_line = lf
910
max_line_length=150
1011

1112
# Interfaces should start with I and PascalCase

.gitattributes

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Set default behavior to automatically normalize line endings to LF
2+
* text=auto eol=lf
3+
4+
# Explicitly declare text files you want to always be normalized and converted to native line endings on checkout
5+
*.cs text eol=lf
6+
*.csproj text eol=lf
7+
*.sln text eol=lf
8+
*.config text eol=lf
9+
*.json text eol=lf
10+
*.xml text eol=lf
11+
*.md text eol=lf
12+
*.txt text eol=lf
13+
*.sh text eol=lf
14+
*.yml text eol=lf
15+
*.resx text eol=lf
16+
17+
# Denote all files that are truly binary and should not be modified
18+
*.dll binary
19+
*.exe binary
20+
*.gpg binary
21+
*.crt binary
22+
*.dmp binary
Lines changed: 108 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -1,108 +1,108 @@
1-
using NUnit.Framework;
2-
using System.Data;
3-
using System.Data.Common;
4-
5-
namespace Snowflake.Data.Tests.IntegrationTests
6-
{
7-
8-
[TestFixture]
9-
class SFDbFactoryIT : SFBaseTest
10-
{
11-
DbProviderFactory _factory;
12-
DbCommand _command;
13-
DbConnection _connection;
14-
15-
[SetUp]
16-
public new void BeforeTest()
17-
{
18-
#if NETFRAMEWORK
19-
_factory = DbProviderFactories.GetFactory("Snowflake.Data");
20-
#else
21-
// In .NET Standard, DbProviderFactories is gone.
22-
// Reference https://weblog.west-wind.com/posts/2017/Nov/27/Working-around-the-lack-of-dynamic-DbProviderFactory-loading-in-NET-Core
23-
// for more details
24-
_factory = Snowflake.Data.Client.SnowflakeDbFactory.Instance;
25-
#endif
26-
27-
_command = _factory.CreateCommand();
28-
_connection = _factory.CreateConnection();
29-
30-
_connection.ConnectionString = ConnectionString;
31-
_connection.Open();
32-
}
33-
34-
[TearDown]
35-
public new void AfterTest()
36-
{
37-
_connection.Close();
38-
}
39-
40-
[Test]
41-
public void TestSimpleDbFactory()
42-
{
43-
// set commnad's connection object
44-
_command.Connection = _connection;
45-
_command.CommandText = "select 1";
46-
47-
object res = _command.ExecuteScalar();
48-
49-
Assert.AreEqual(1, res);
50-
}
51-
52-
[Test]
53-
public void TestDbFactoryWithParameter()
54-
{
55-
int expectedIntValue = 1;
56-
57-
DbParameter parameter = _factory.CreateParameter();
58-
parameter.ParameterName = "1";
59-
parameter.Value = expectedIntValue;
60-
parameter.DbType = DbType.Int16;
61-
_command.Parameters.Add(parameter);
62-
63-
// set command's connection object
64-
_command.Connection = _connection;
65-
_command.CommandText = "select ?";
66-
67-
var result = _command.ExecuteScalar();
68-
69-
Assert.AreEqual(expectedIntValue, result);
70-
}
71-
72-
[Test]
73-
public void TestDbFactoryWithConnectionStringBuilder()
74-
{
75-
DbConnectionStringBuilder builder = _factory.CreateConnectionStringBuilder();
76-
builder.ConnectionString = ConnectionString;
77-
78-
_connection.ConnectionString = builder.ConnectionString;
79-
_connection.Open();
80-
81-
// set command's connection object
82-
_command.Connection = _connection;
83-
_command.CommandText = "select 1";
84-
85-
var result = _command.ExecuteScalar();
86-
87-
Assert.AreEqual(1, result);
88-
}
89-
90-
[Test]
91-
public void TestDbFactoryWithCommandBuilderAndAdapter()
92-
{
93-
// set command's connection object
94-
_command.Connection = _connection;
95-
_command.CommandText = "select 1";
96-
97-
DbDataAdapter adapter = _factory.CreateDataAdapter();
98-
adapter.SelectCommand = _command;
99-
DbCommandBuilder builder = _factory.CreateCommandBuilder();
100-
builder.DataAdapter = adapter;
101-
DataSet ds = new DataSet("ds");
102-
103-
adapter.Fill(ds);
104-
105-
Assert.AreEqual(1, ds.Tables[0].Rows[0].ItemArray[0]);
106-
}
107-
}
108-
}
1+
using NUnit.Framework;
2+
using System.Data;
3+
using System.Data.Common;
4+
5+
namespace Snowflake.Data.Tests.IntegrationTests
6+
{
7+
8+
[TestFixture]
9+
class SFDbFactoryIT : SFBaseTest
10+
{
11+
DbProviderFactory _factory;
12+
DbCommand _command;
13+
DbConnection _connection;
14+
15+
[SetUp]
16+
public new void BeforeTest()
17+
{
18+
#if NETFRAMEWORK
19+
_factory = DbProviderFactories.GetFactory("Snowflake.Data");
20+
#else
21+
// In .NET Standard, DbProviderFactories is gone.
22+
// Reference https://weblog.west-wind.com/posts/2017/Nov/27/Working-around-the-lack-of-dynamic-DbProviderFactory-loading-in-NET-Core
23+
// for more details
24+
_factory = Snowflake.Data.Client.SnowflakeDbFactory.Instance;
25+
#endif
26+
27+
_command = _factory.CreateCommand();
28+
_connection = _factory.CreateConnection();
29+
30+
_connection.ConnectionString = ConnectionString;
31+
_connection.Open();
32+
}
33+
34+
[TearDown]
35+
public new void AfterTest()
36+
{
37+
_connection.Close();
38+
}
39+
40+
[Test]
41+
public void TestSimpleDbFactory()
42+
{
43+
// set commnad's connection object
44+
_command.Connection = _connection;
45+
_command.CommandText = "select 1";
46+
47+
object res = _command.ExecuteScalar();
48+
49+
Assert.AreEqual(1, res);
50+
}
51+
52+
[Test]
53+
public void TestDbFactoryWithParameter()
54+
{
55+
int expectedIntValue = 1;
56+
57+
DbParameter parameter = _factory.CreateParameter();
58+
parameter.ParameterName = "1";
59+
parameter.Value = expectedIntValue;
60+
parameter.DbType = DbType.Int16;
61+
_command.Parameters.Add(parameter);
62+
63+
// set command's connection object
64+
_command.Connection = _connection;
65+
_command.CommandText = "select ?";
66+
67+
var result = _command.ExecuteScalar();
68+
69+
Assert.AreEqual(expectedIntValue, result);
70+
}
71+
72+
[Test]
73+
public void TestDbFactoryWithConnectionStringBuilder()
74+
{
75+
DbConnectionStringBuilder builder = _factory.CreateConnectionStringBuilder();
76+
builder.ConnectionString = ConnectionString;
77+
78+
_connection.ConnectionString = builder.ConnectionString;
79+
_connection.Open();
80+
81+
// set command's connection object
82+
_command.Connection = _connection;
83+
_command.CommandText = "select 1";
84+
85+
var result = _command.ExecuteScalar();
86+
87+
Assert.AreEqual(1, result);
88+
}
89+
90+
[Test]
91+
public void TestDbFactoryWithCommandBuilderAndAdapter()
92+
{
93+
// set command's connection object
94+
_command.Connection = _connection;
95+
_command.CommandText = "select 1";
96+
97+
DbDataAdapter adapter = _factory.CreateDataAdapter();
98+
adapter.SelectCommand = _command;
99+
DbCommandBuilder builder = _factory.CreateCommandBuilder();
100+
builder.DataAdapter = adapter;
101+
DataSet ds = new DataSet("ds");
102+
103+
adapter.Fill(ds);
104+
105+
Assert.AreEqual(1, ds.Tables[0].Rows[0].ItemArray[0]);
106+
}
107+
}
108+
}

0 commit comments

Comments
 (0)