public async Task ExecuteFuncTest() { // Arrange var config = new CodeConfiguration(); // Act var result = await config.ExecuteAsync(() => true); // Assert Assert.True(result); }
public async Task ExecuteActionTest() { // Arrange var config = new CodeConfiguration(); var num = 0; // Act await config.ExecuteAsync(() => { num++; }); // Assert Assert.AreEqual(1, num); }
public async Task ExecuteFuncAsyncTest() { // Arrange var config = new CodeConfiguration(); // Act var result = await config.ExecuteAsync(async() => { await Task.Yield(); return(true); }); // Assert Assert.True(result); }
public async Task ExecuteActionRetryTest() { // Arrange var config = new CodeConfiguration(); var num = 0; // Act await config.ExecuteAsync(() => { num++; throw new Exception(); }, e => { num++; }); // Assert Assert.AreEqual(4, num); }
public async Task ExecuteFuncRetryTest() { // Arrange var config = new CodeConfiguration(); var num = 0; // Act var actual = await config.ExecuteAsync(() => { num++; throw new Exception(); }, e => { num++; return(num); }); // Assert Assert.AreEqual(4, actual); }
public async Task ExecuteFuncRetryTest() { // Arrange var config = new CodeConfiguration(); var num = 0; // Act var actual = await config.ExecuteAsync(() => { num++; throw new Exception(); }, e => { num++; return num; }); // Assert Assert.AreEqual(4, actual); }
public async Task ExecuteFuncAsyncTest() { // Arrange var config = new CodeConfiguration(); // Act var result = await config.ExecuteAsync(async () => { await Task.Yield(); return true; }); // Assert Assert.True(result); }