Exemplo n.º 1
0
        public async ValueTask TestAssemblyCleanupFailure()
        {
            var collectionStarting = new _TestAssemblyStarting
            {
                AssemblyUniqueID = assemblyID,
                AssemblyPath     = "assembly-file-path"
            };
            var collectionCleanupFailure = new _TestAssemblyCleanupFailure
            {
                AssemblyUniqueID       = assemblyID,
                ExceptionParentIndices = exceptionParentIndices,
                ExceptionTypes         = exceptionTypes,
                Messages    = messages,
                StackTraces = stackTraces
            };
            var listener = Substitute.For <ITestListener>();

            await using var sink = new ResultSink(listener, 42)
                        {
                            TestRunState = TestRunState.NoTests
                        };

            sink.OnMessage(collectionStarting);
            sink.OnMessage(collectionCleanupFailure);

            AssertFailure(listener, sink.TestRunState, "Test Assembly Cleanup Failure (assembly-file-path)");
        }
    public void TestAssemblyCleanupFailure()
    {
        var collectionStarting = new _TestAssemblyStarting
        {
            AssemblyUniqueID         = assemblyID,
            AssemblyName             = "assembly-name",
            AssemblyPath             = "assembly-file-path",
            ConfigFilePath           = "config-file-path",
            StartTime                = DateTimeOffset.UtcNow,
            TargetFramework          = "target-framework",
            TestEnvironment          = "test-environment",
            TestFrameworkDisplayName = "test-framework"
        };
        var collectionCleanupFailure = new _TestAssemblyCleanupFailure
        {
            AssemblyUniqueID       = assemblyID,
            ExceptionParentIndices = exceptionParentIndices,
            ExceptionTypes         = exceptionTypes,
            Messages    = messages,
            StackTraces = stackTraces
        };
        var assemblyElement = new XElement("assembly");
        var sink            = new DelegatingXmlCreationSink(innerSink, assemblyElement);

        sink.OnMessage(collectionStarting);
        sink.OnMessage(collectionCleanupFailure);

        AssertFailureElement(assemblyElement, "assembly-cleanup", "assembly-file-path");
    }
        public void TestAssemblyCleanupFailure()
        {
            var assemblyStarting = new _TestAssemblyStarting
            {
                AssemblyUniqueID = assemblyID,
                AssemblyPath     = @"C:\Foo\bar.dll"
            };
            var assemblyCleanupFailure = new _TestAssemblyCleanupFailure
            {
                AssemblyUniqueID       = assemblyID,
                ExceptionParentIndices = exceptionParentIndices,
                ExceptionTypes         = exceptionTypes,
                Messages    = messages,
                StackTraces = stackTraces
            };
            var handler = TestableDefaultRunnerReporterMessageHandler.Create();

            handler.OnMessage(assemblyStarting);
            handler.OnMessage(assemblyCleanupFailure);

            AssertFailureMessages(handler.Messages, @"Test Assembly Cleanup Failure (C:\Foo\bar.dll)");
        }
        public void TestAssemblyCleanupFailure()
        {
            var collectionStarting = new _TestAssemblyStarting
            {
                AssemblyUniqueID = assemblyID,
                AssemblyPath     = "assembly-file-path"
            };
            var collectionCleanupFailure = new _TestAssemblyCleanupFailure
            {
                AssemblyUniqueID       = assemblyID,
                ExceptionParentIndices = exceptionParentIndices,
                ExceptionTypes         = exceptionTypes,
                Messages    = messages,
                StackTraces = stackTraces
            };
            var handler = TestableTeamCityReporterMessageHandler.Create();

            handler.OnMessage(collectionStarting);
            handler.OnMessage(collectionCleanupFailure);

            AssertFailureMessage(handler.Messages, "Test Assembly Cleanup Failure (assembly-file-path)");
        }