Exemple #1
0
        public void EnumerateServiceDescriptors_Always_ResultsAreExpected(
            Assembly assembly,
            ImmutableArray<ServiceDescriptorExpectation> expectedResults)
        {
            var results = ServiceBindingAttribute.EnumerateServiceDescriptors(
                    assembly)
                .ToArray();

            var unmatchedResults = results.ToHashSet();

            foreach(var expectedResult in expectedResults)
            {
                results.ShouldContain(result => expectedResult.MatchesActual(result));

                var result = unmatchedResults.First(result => expectedResult.MatchesActual(result));

                if(expectedResult.ImplementationFactoryServiceType is { })