< Summary

Information
Class: SwitchBlade.Core.ProcessFactory
Assembly: SwitchBlade
File(s): D:\a\switchblade\switchblade\Core\ProcessFactory.cs
Tag: 203_23722840422
Line coverage
100%
Covered lines: 12
Uncovered lines: 0
Coverable lines: 12
Total lines: 29
Line coverage: 100%
Branch coverage
100%
Covered branches: 4
Total branches: 4
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%22100%
Start(...)100%22100%
GetCurrentProcess()100%11100%
get_ProcessPath()100%11100%

File(s)

D:\a\switchblade\switchblade\Core\ProcessFactory.cs

#LineLine coverage
 1using System;
 2using System.Diagnostics;
 3using SwitchBlade.Contracts;
 4
 5namespace SwitchBlade.Core
 6{
 7    public class ProcessFactory : IProcessFactory
 8    {
 9        private readonly ISystemProcessProvider _provider;
 10
 2911        public ProcessFactory(ISystemProcessProvider provider)
 2912        {
 2913            _provider = provider ?? throw new ArgumentNullException(nameof(provider));
 2814        }
 15
 16        public IProcess? Start(ProcessStartInfo startInfo)
 817        {
 818            var process = _provider.Start(startInfo);
 719            return process != null ? new ProcessWrapper(process) : null;
 720        }
 21
 22        public IProcess GetCurrentProcess()
 523        {
 524            return new ProcessWrapper(_provider.GetCurrentProcess());
 525        }
 26
 227        public string? ProcessPath => _provider.ProcessPath;
 28    }
 29}