Ejemplo n.º 1
0
        public async Task Run()
        {
            var definition      = JsonConvert.DeserializeObject <ScriptPeriodicTaskDefinition>(File.ReadAllText(DefinitionPath));
            var sut             = new ScriptPeriodTask(definition);
            var executionResult = await sut.Action(CancellationToken.None);

            Assert.That(executionResult.IsSuccess, Is.True);
        }
Ejemplo n.º 2
0
        public async Task FailingScriptReturnsAsUnsuccessful()
        {
            var definition      = JsonConvert.DeserializeObject <ScriptPeriodicTaskDefinition>(File.ReadAllText(DefinitionPath));
            var sut             = new ScriptPeriodTask(definition);
            var executionResult = await sut.Action(CancellationToken.None);

            Console.WriteLine(executionResult.Summary);
            Assert.That(executionResult.IsSuccess, Is.False);
        }