Webiant Logo Webiant Logo
  1. No results found.

    Try your search with a different keyword or use * as a wildcard.

TypeFinderTests.cs

using FluentAssertions;
using Nop.Core.Infrastructure;
using NUnit.Framework;

namespace Nop.Tests.Nop.Core.Tests.Infrastructure;

[TestFixture]
public class TypeFinderTests : BaseNopTest
{
    [Test]
    public void TypeFinderBenchmarkFindings()
    {
        var finder = GetService<ITypeFinder>();
        var type = finder.FindClassesOfType<ISomeInterface>().ToList();
        type.Count.Should().Be(1);
        typeof(ISomeInterface).IsAssignableFrom(type.FirstOrDefault()).Should().BeTrue();
    }

    public interface ISomeInterface;

    public class SomeClass : ISomeInterface;
}