Skip to content

Xunit test framework fails to find tests #20

Open
@Blueknight10001

Description

@Blueknight10001

When writing test classes and using the line [assembly: Xunit.TestFramework("Elastic.Xunit.Sdk.ElasticTestFramework", "Elastic.Xunit")], none of the tests (even the non Elastic tests) are discovered. I'm sure it's something simple I'm missing, but I can't find anything. I've used Visual Studio 2019 and the command line to no avail.

It's almost an exact copy of the ExampleMinimal.

using API.Entities;
using Elastic.Xunit.XunitPlumbing;
using Elasticsearch.Net;
using Nest;
using System;
using System.Collections.Generic;
using System.Text;
using FluentAssertions;
using Elastic.Xunit;
using Elastic.Xunit.Sdk;

namespace TrackItTest
{
    public class MyTestCluster : XunitClusterBase
    {
        public MyTestCluster() : base(new XunitClusterConfiguration("6.2.0") { })
        {
        }

    }

    public class ExampleTest : IClusterFixture<MyTestCluster>
    {
        private ElasticClient _client;
        public ExampleTest(MyTestCluster cluster)
        {
            _client = cluster.GetOrAddClient(c =>
            {
                var nodes = cluster.NodesUris();
                var connectionPool = new StaticConnectionPool(nodes);
                var settings = new ConnectionSettings(connectionPool)
                    .EnableDebugMode();
                return new ElasticClient(settings);
            });
        }

        [I]
        public void GetTrackableTest()
        {
            var rootNodeInfo = _client.RootNodeInfo();

            rootNodeInfo.Name.Should().NotBeNullOrEmpty();
        }
    }
}
`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions