Exemplo n.º 1
0
        public void Constructor_Always_InitialzesInstance(
            ServiceLifetime lifetime)
        {
            var result = new ServiceBindingAttribute(
                lifetime);

            result.Lifetime.ShouldBe(lifetime);
        }
Exemplo n.º 2
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 { })
Exemplo n.º 3
0
 public void Init(AppInfo appInfo, ServiceBindingAttribute bindingAtt)
 {
     Init(appInfo, bindingAtt as TSrvBindingAtt);
 }