Esempio n. 1
0
        public VsTestTestClass(IVsTestTestRunner testRunner, Project project, VsTestUnitTest vsTestUnit)
            : base(vsTestUnit.FixtureTypeName)
        {
            Project                  = project;
            this.testRunner          = testRunner;
            FixtureTypeName          = vsTestUnit.FixtureTypeName;
            TestSourceCodeDocumentId = string.IsNullOrEmpty(vsTestUnit.FixtureTypeNamespace) ? FixtureTypeName : vsTestUnit.FixtureTypeNamespace + "." + FixtureTypeName;
            cts = new CancellationTokenSource();
            var token = cts.Token;

            IdeApp.TypeSystemService.GetCompilationAsync(Project, token).ContinueWith((t) => {
                if (token.IsCancellationRequested)
                {
                    return;
                }
                var className   = TestSourceCodeDocumentId;
                var compilation = t.Result;
                if (compilation == null)
                {
                    return;
                }
                var cls = compilation.GetTypeByMetadataName(className);
                if (cls == null)
                {
                    return;
                }
                var source = cls.Locations.FirstOrDefault(l => l.IsInSource);
                if (source == null)
                {
                    return;
                }
                var line           = source.GetLineSpan();
                sourceCodeLocation = new SourceCodeLocation(source.SourceTree.FilePath, line.StartLinePosition.Line, line.StartLinePosition.Character);
            }, token, TaskContinuationOptions.NotOnFaulted, TaskScheduler.Default).Ignore();
        }
Esempio n. 2
0
 public VsTestTestClass(IVsTestTestRunner testRunner, Project project, string name)
     : base(name)
 {
     this.Project    = project;
     this.testRunner = testRunner;
     FixtureTypeName = name;
 }
Esempio n. 3
0
 public VsTestTestClass(IVsTestTestRunner testRunner, Project project, VsTestUnitTest vsTestUnit)
     : base(vsTestUnit.FixtureTypeName)
 {
     this.Project             = project;
     this.testRunner          = testRunner;
     FixtureTypeName          = vsTestUnit.FixtureTypeName;
     TestSourceCodeDocumentId = string.IsNullOrEmpty(vsTestUnit.FixtureTypeNamespace) ? FixtureTypeName : vsTestUnit.FixtureTypeNamespace + "." + FixtureTypeName;
 }
Esempio n. 4
0
        public VsTestUnitTest(IVsTestTestRunner testRunner, TestCase test, MonoDevelop.Projects.Project project)
            : base(test.DisplayName)
        {
            this.Project    = project;
            this.testRunner = testRunner;
            this.test       = test;

            Init();
        }
        public VsTestNamespaceTestGroup(IVsTestTestRunner testRunner, UnitTestGroup parent, Project project, string name)
            : base(name)
        {
            this.Project     = project;
            currentNamespace = this;
            this.testRunner  = testRunner;

            if (parent == null || String.IsNullOrEmpty(parent.FixtureTypeNamespace))
            {
                FixtureTypeNamespace = name;
            }
            else
            {
                FixtureTypeNamespace = parent.FixtureTypeNamespace + "." + name;
            }
        }