Skip to content

Commit dbc1d38

Browse files
committed
Better test for job constructor arguments roundtrip
1 parent 928da7f commit dbc1d38

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Diff for: tests/Hangfire.Core.Tests/Common/JobFacts.cs

+8-6
Original file line numberDiff line numberDiff line change
@@ -149,15 +149,17 @@ public void Ctor_ThrowsAnException_WhenMethodContains_UnassignedGenericTypeParam
149149
}
150150

151151
[Fact]
152-
public void Ctor_CorrectlyPasses_ReadOnlyListOfArguments()
152+
public void Ctor_CanUsePropertyValues_OfAnotherJob_AsItsArguments()
153153
{
154154
var method = _type.GetMethod("MethodWithArguments");
155-
IReadOnlyList<object> args = new List<object> { "hello", 123 };
156-
var job = new Job(_type, method, args);
155+
var job = new Job(_type, method, "hello", 456);
157156

158-
Assert.NotNull(job);
159-
Assert.Equal("hello", job.Args[0]);
160-
Assert.Equal(123, job.Args[1]);
157+
var anotherJob = new Job(job.Type, job.Method, job.Args);
158+
159+
Assert.Equal(_type, anotherJob.Type);
160+
Assert.Equal(method, anotherJob.Method);
161+
Assert.Equal("hello", anotherJob.Args[0]);
162+
Assert.Equal(456, anotherJob.Args[1]);
161163
}
162164

163165
[Fact]

0 commit comments

Comments
 (0)