Пример #1
0
        public void CreateRuntimeResultCreatesCancelledResult(string output, double timeoutLimit)
        {
            var timeout       = TimeSpan.FromSeconds(timeoutLimit);
            var runtimeResult = SapsRunner.CreateRuntimeResult(output, timeout);

            runtimeResult.IsCancelled.ShouldBeTrue("Expected cancelled result.");
            runtimeResult.Runtime.TotalSeconds.ShouldBe(timeoutLimit, "Expected different runtime in result.");
        }
Пример #2
0
        public void CreateRuntimeResultCreatesCorrectResult(double runtime, double timeoutLimit)
        {
            var output        = $"CPUTime_Median = {runtime.ToString(CultureInfo.InvariantCulture)}";
            var timeout       = TimeSpan.FromSeconds(timeoutLimit);
            var runtimeResult = SapsRunner.CreateRuntimeResult(output, timeout);

            runtimeResult.IsCancelled.ShouldBeFalse("Expected not cancelled result.");
            runtimeResult.Runtime.TotalSeconds.ShouldBe(runtime, 1e-6, "Expected different runtime in result.");
        }