Skip to content

Commit da9682d

Browse files
committed
Added ignoring of inconsitent test when it is inconsistent
1 parent 4b89d37 commit da9682d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Orm/Xtensive.Orm.Tests/Issues/IssueJira0421_DateTimeAddXxx.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,21 @@ public void AddSecondsTest()
115115
[Test]
116116
public void AddMillisecondsTest()
117117
{
118-
CheckNotMySql55();
118+
CheckNotMySql55NorSqlServer2005();
119119
RunAllTestsDouble(value => e => e.Today.AddMilliseconds(value) == today.AddMilliseconds(value));
120120
}
121121

122-
private void CheckNotMySql55()
122+
private void CheckNotMySql55NorSqlServer2005()
123123
{
124-
if (StorageProviderInfo.Instance.CheckProviderIs(StorageProvider.MySql)
125-
&& StorageProviderInfo.Instance.CheckProviderVersionIsAtMost(StorageProviderVersion.MySql56)) {
124+
var storageProviderInfo = StorageProviderInfo.Instance;
125+
if (storageProviderInfo.CheckProviderIs(StorageProvider.MySql)
126+
&& storageProviderInfo.CheckProviderVersionIsAtMost(StorageProviderVersion.MySql56)) {
126127
throw new IgnoreException("Test requires MySQL version greater than 5.5");
127128
}
129+
if (storageProviderInfo.CheckProviderIs(StorageProvider.SqlServer)
130+
&& storageProviderInfo.CheckProviderVersionIsAtMost(StorageProviderVersion.SqlServer2005)) {
131+
throw new IgnoreException("MS SQL Server 2005rounds miliseconds of DateTime so test is inconsistent.");
132+
}
128133
}
129134
}
130135
}

0 commit comments

Comments
 (0)