public async Task AutomationScenario1TestAsync() { _defaultAutomation.Actions.Add(new DelayAction(_defaultAutomation.AutomationId, TimeSpan.FromSeconds(1))); var stopwatch = new Stopwatch(); stopwatch.Start(); var result1 = await _automationService.ExecuteAsync(_defaultAutomation, _defaultCustomer); stopwatch.Stop(); // Assert should succeed because condition is met. Assert.IsTrue(result1.Succeeded); // Assert should succeed because condition is met and delay is applied. Assert.IsTrue(stopwatch.Elapsed > TimeSpan.FromSeconds(1)); stopwatch.Reset(); var customer2 = new Customer() { Name = "Test2", Age = 16 }; stopwatch.Start(); var result2 = await _automationService.ExecuteAsync(_defaultAutomation, customer2); stopwatch.Stop(); // Assert should fail because condition is not met. Age is below 18. Assert.IsFalse(result2.Succeeded); // Assert should fail because no condition is met to run the action. Assert.IsFalse(stopwatch.Elapsed > TimeSpan.FromSeconds(1)); }