-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMicrosoftDataSqlClientVersionTests.cs
More file actions
32 lines (27 loc) · 1.25 KB
/
MicrosoftDataSqlClientVersionTests.cs
File metadata and controls
32 lines (27 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System.Reflection;
using Shouldly;
using Xunit;
namespace DbUp.SqlServer.Tests;
public class MicrosoftDataSqlClientVersionTests
{
[Fact]
public void Microsoft_Data_SqlClient_Is_Lowest_Supported_Lts()
{
var assembly = typeof(Microsoft.Data.SqlClient.SqlConnection).Assembly;
var version = assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
// https://learn.microsoft.com/en-us/sql/connect/ado-net/sqlclient-driver-support-lifecycle
version.ShouldNotBeNull();
version.InformationalVersion.ShouldStartWith("6.1.", customMessage: "We want to stay on 6.1.x as it is the lowest LTS version which is in support (ends 14 Aug, 2028)");
}
[Fact]
public void Microsoft_Data_SqlClient_Is_In_Support()
{
// Arrange
var supportEndDate = new DateTime(2028, 8, 14);
var currentDate = DateTime.UtcNow;
// Assert
currentDate.ShouldBeLessThanOrEqualTo(supportEndDate,
$"Microsoft.Data.SqlClient 6.1.x support ends on {supportEndDate:yyyy-MM-dd}. " +
$"Current date is {currentDate:yyyy-MM-dd}. We should upgrade to the latest lowest lts https://learn.microsoft.com/en-us/sql/connect/ado-net/sqlclient-driver-support-lifecycle.");
}
}