Example #1
0
        /// <summary>
        /// Will remove a test container for a given file path
        /// </summary>
        /// <param name="file"></param>
        private void RemoveTestContainer(TestFileCandidate file)
        {
            // If a settings file don't add a container
            if (fileProbe.IsChutzpahSettingsFile(file.Path))
            {
                return;
            }

            ITestContainer container;
            var            res = cachedContainers.TryRemove(file.Path, out container);

            if (res)
            {
                ChutzpahTracer.TraceInformation("Removed test container for '{0}'", file.Path);
            }
        }
        /// <summary>
        /// Will remove a test container for a given file path
        /// </summary>
        /// <param name="file"></param>
        private void RemoveTestContainer(TestFileCandidate file)
        {
            // If a settings file don't add a container
            if (fileProbe.IsChutzpahSettingsFile(file.Path))
            {
                return;
            }

            var index = cachedContainers.FindIndex(x => x.Source.Equals(file.Path, StringComparison.OrdinalIgnoreCase));

            if (index >= 0)
            {
                ChutzpahTracer.TraceInformation("Removed test container for '{0}'", file.Path);
                cachedContainers.RemoveAt(index);
            }
        }
Example #3
0
        /// <summary>
        /// Adds a test container for the given file if it is a test file.
        /// This will first remove any existing container for that file
        /// </summary>
        /// <param name="file"></param>
        private void AddTestContainerIfTestFile(TestFileCandidate file)
        {
            // If a settings file don't add a container
            if (fileProbe.IsChutzpahSettingsFile(file.Path))
            {
                return;
            }

            var isTestFile = IsTestFile(file.Path);

            RemoveTestContainer(file); // Remove if there is an existing container

            if (isTestFile)
            {
                ChutzpahTracer.TraceInformation("Added test container for '{0}'", file.Path);
                var container = new JsTestContainer(this, file.Path.ToLowerInvariant(), AdapterConstants.ExecutorUri);
                cachedContainers[container.Source] = container;
            }
        }
 public TestFileChangedEventArgs(string file, TestFileChangedReason reason)
 {
     File = new TestFileCandidate(file);
     ChangedReason = reason;
 }
        /// <summary>
        /// Will remove a test container for a given file path
        /// </summary>
        /// <param name="file"></param>
        private void RemoveTestContainer(TestFileCandidate file)
        {
            // If a settings file don't add a container
            if (fileProbe.IsChutzpahSettingsFile(file.Path))
            {
                return;
            }

            ITestContainer container;
            var res = cachedContainers.TryRemove(file.Path, out container);
            if (res)
            {
                ChutzpahTracer.TraceInformation("Removed test container for '{0}'", file.Path);
            }
        }
        /// <summary>
        /// Adds a test container for the given file if it is a test file.
        /// This will first remove any existing container for that file
        /// </summary>
        /// <param name="file"></param>
        private void AddTestContainerIfTestFile(TestFileCandidate file)
        {
            // If a settings file don't add a container
            if (fileProbe.IsChutzpahSettingsFile(file.Path))
            {
                return;
            }

            var isTestFile = IsTestFile(file.Path);

            RemoveTestContainer(file); // Remove if there is an existing container

            if (isTestFile)
            {

                ChutzpahTracer.TraceInformation("Added test container for '{0}'", file.Path);
                var container = new JsTestContainer(this, file.Path.ToLowerInvariant(), AdapterConstants.ExecutorUri);
                cachedContainers[container.Source] = container;
            }
        }