protected UnitTestBase(IUnitTestTrace output, string projectDirectory, [CallerFilePath] string filePath = "")
     : base(output, projectDirectory, filePath)
 {
     if (GetService <IAdal>() is null)
     {
         SetService(new Adal(Context));
     }
 }
예제 #2
0
        public UnitTestTrace(Git.ITrace trace, IUnitTestTrace other)
        {
            if (trace is null)
            {
                throw new ArgumentNullException(nameof(trace));
            }
            if (other is null)
            {
                throw new ArgumentNullException(nameof(other));
            }

            _other = other;
            _trace = trace;
        }
예제 #3
0
        protected UnitTestBase(IUnitTestTrace output, string projectDirectory, [CallerFilePath] string filePath = "")
            : base(RuntimeContext.Create())
        {
            if (output is null)
            {
                throw new ArgumentNullException(nameof(output));
            }

            if (string.IsNullOrWhiteSpace(filePath))
            {
                filePath = Invariant($"{nameof(UnitTestBase)}.cs");
            }

            TestMode = ProjectTestMode;

            _filePath         = filePath;
            _iteration        = -1;
            _projectDirectory = projectDirectory ?? Directory.GetParent(filePath).FullName;
            _tempDirectory    = Path.GetTempPath();
            _testInstanceName = Guid.NewGuid().ToString("N");

            while (_projectDirectory != null &&
                   !Directory.EnumerateFiles(_projectDirectory)
                   .Any(x => OrdinalIgnoreCase.Equals(Path.GetExtension(x), ".csproj")))
            {
                _projectDirectory = Path.GetDirectoryName(_projectDirectory);
            }

            _solutionDirectory = FindSolutionDirectory(_projectDirectory);

            Context.Trace = new UnitTestTrace(Context.Trace, output);

            _output = output;

            _output.WriteLine($"Starting {GetType().FullName}.");
        }
 protected UnitTestBase(IUnitTestTrace output, [CallerFilePath] string filePath = "")
     : this(output, null, filePath)
 {
 }