public void VoidTrackWorks() { // arrange var scope = new FakeTrackingScope(); var called = false; void workload() { called = true; } // act scope.Track(workload); // assert Assert.True(called); }
public void VoidTrackWithScopeAndTokenWorks() { // arrange var scope = new FakeTrackingScope(); var called = false; void workload(ITrackingScope scope, CancellationToken token) { called = true; } // act scope.Track(workload, CancellationToken.None); // assert Assert.True(called); }
public void VoidTrackWithIdAndScopeWorks() { // arrange var id = Guid.NewGuid(); var scope = new FakeTrackingScope(); var called = false; void workload(ITrackingScope scope) { called = true; } // act scope.Track(id, workload); // assert Assert.True(called); }
public void ResultTrackWithIdAndScopeWorks() { // arrange var scope = new FakeTrackingScope(); var called = false; int workload(ITrackingScope scope) { called = true; return(123); } // act var result = scope.Track(Guid.NewGuid(), workload); // assert Assert.True(called); Assert.Equal(123, result); }