Skip to content

Commit d90118b

Browse files
author
Vytautas Kasparavičius
committed
Made to build after the merge + updated build scripts
1 parent 0085a3f commit d90118b

7 files changed

+19
-12
lines changed

build.cake

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#addin "Cake.Json"
1+
#addin nuget:?package=Newtonsoft.Json&version=9.0.1
22

33
//////////////////////////////////////////////////////////////////////
44
// ARGUMENTS
@@ -12,7 +12,7 @@ var target = Argument("target", "Default");
1212

1313
IEnumerable<string> GetFrameworks(string path)
1414
{
15-
return new string[] { "netstandard1.4", "net451" };
15+
return new string[] { "netstandard2.0", "net451" };
1616
}
1717

1818
//////////////////////////////////////////////////////////////////////

src/Hangfire.PostgreSql/Hangfire.PostgreSql.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<PackageReference Include="Hangfire.Core" Version="1.6.20" />
3030
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
3131
<PackageReference Include="Newtonsoft.Json" Version="10.0.1" />
32+
<PackageReference Include="Npgsql" Version="4.0.3" />
3233
</ItemGroup>
3334

3435
<ItemGroup Condition=" '$(TargetFramework)' == 'net451' ">

tests/Hangfire.PostgreSql.Tests/PersistentJobQueueProviderCollectionFacts.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void Enumeration_IncludesTheDefaultProvider()
3131

3232
var result = collection.ToArray();
3333

34-
Assert.Equal(1, result.Length);
34+
Assert.Single(result);
3535
Assert.Same(_defaultProvider.Object, result[0]);
3636
}
3737

tests/Hangfire.PostgreSql.Tests/PostgreSqlConnectionFacts.cs

+5-3
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ public void CreateExpiredJob_CreatesAJobInTheStorage_AndSetsItsParameters()
191191
var sqlJob = sql.Query(@"select * from """ + GetSchemaName() + @""".""job""").Single();
192192
Assert.Equal(jobId, sqlJob.id.ToString());
193193
Assert.Equal(createdAt, sqlJob.createdat);
194-
Assert.Equal(null, (int?) sqlJob.stateid);
195-
Assert.Equal(null, (string) sqlJob.statename);
194+
Assert.Null((int?) sqlJob.stateid);
195+
Assert.Null((string) sqlJob.statename);
196196

197197
var invocationData = JobHelper.FromJson<InvocationData>((string) sqlJob.invocationdata);
198198
invocationData.Arguments = sqlJob.arguments;
@@ -712,7 +712,7 @@ public void GetAllItemsFromSet_ReturnsEmptyCollection_WhenKeyDoesNotExist()
712712
var result = connection.GetAllItemsFromSet("some-set");
713713

714714
Assert.NotNull(result);
715-
Assert.Equal(0, result.Count);
715+
Assert.Empty(result);
716716
});
717717
}
718718

@@ -1349,7 +1349,9 @@ private static string GetSchemaName()
13491349
return ConnectionUtils.GetSchemaName();
13501350
}
13511351

1352+
#pragma warning disable xUnit1013 // Public method should be marked as test
13521353
public static void SampleMethod(string arg)
1354+
#pragma warning restore xUnit1013 // Public method should be marked as test
13531355
{
13541356
}
13551357
}

tests/Hangfire.PostgreSql.Tests/PostgreSqlDistributedLockFacts.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public void Ctor_AcquiresExclusiveApplicationLock_WithUseNativeDatabaseTransacti
6363
@"select count(*) from """ + GetSchemaName() + @""".""lock"" where ""resource"" = @resource",
6464
new { resource = "hello" }).Single();
6565

66-
Assert.Equal(lockCount, 1);
66+
Assert.Equal(1, lockCount);
6767
//Assert.Equal("Exclusive", lockMode);
6868
});
6969
}
@@ -111,7 +111,7 @@ public void Ctor_AcquiresExclusiveApplicationLock_WithoutUseNativeDatabaseTransa
111111
@"select count(*) from """ + GetSchemaName() + @""".""lock"" where ""resource"" = @resource",
112112
new { resource = "hello" }).Single();
113113

114-
Assert.Equal(lockCount, 1);
114+
Assert.Equal(1, lockCount);
115115
//Assert.Equal("Exclusive", lockMode);
116116
});
117117
}
@@ -202,7 +202,7 @@ public void Dispose_ReleasesExclusiveApplicationLock_WithUseNativeDatabaseTransa
202202
@"select count(*) from """ + GetSchemaName() + @""".""lock"" where ""resource"" = @resource",
203203
new { resource = "hello" }).Single();
204204

205-
Assert.Equal(lockCount, 0);
205+
Assert.Equal(0, lockCount);
206206
});
207207
}
208208

@@ -224,7 +224,7 @@ public void Dispose_ReleasesExclusiveApplicationLock_WithoutUseNativeDatabaseTra
224224
@"select count(*) from """ + GetSchemaName() + @""".""lock"" where ""resource"" = @resource",
225225
new { resource = "hello" }).Single();
226226

227-
Assert.Equal(lockCount, 0);
227+
Assert.Equal(0, lockCount);
228228
});
229229
}
230230

tests/Hangfire.PostgreSql.Tests/PostgreSqlJobQueueFacts.cs

+2
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,9 @@ private static CancellationToken CreateTimingOutCancellationToken()
448448
return source.Token;
449449
}
450450

451+
#pragma warning disable xUnit1013 // Public method should be marked as test
451452
public static void Sample(string arg1, string arg2)
453+
#pragma warning restore xUnit1013 // Public method should be marked as test
452454
{
453455
}
454456

tests/Hangfire.PostgreSql.Tests/PostgreSqlMonitoringApiFacts.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,10 @@ private void Commit(
9191
}
9292
}
9393

94-
public static void SampleMethod(string arg)
95-
{
94+
#pragma warning disable xUnit1013 // Public method should be marked as test
95+
public static void SampleMethod(string arg)
96+
#pragma warning restore xUnit1013 // Public method should be marked as test
97+
{
9698
}
9799
}
98100
}

0 commit comments

Comments
 (0)