public void Value_TwoSameValuesAsErrorsArgument_ShouldThrowComposition()
        {
            var errorIds = Expectations.GetEnumValues <CompositionErrorId>();

            foreach (var errorId in errorIds)
            {
                var result = CreateCompositionResult <string>(errorId, errorId);

                CompositionAssert.ThrowsErrors((ErrorId)errorId, (ErrorId)errorId, () =>
                {
                    var value = result.Value;
                });
            }
        }
        public void ConstructorInjectionCycle()
        {
            var container          = ContainerFactory.Create();
            CompositionBatch batch = new CompositionBatch();

            batch.AddPart(new ConstructorInjectionComposablePart(typeof(AClass)));
            batch.AddPart(new ConstructorInjectionComposablePart(typeof(BClass)));

            CompositionAssert.ThrowsErrors(ErrorId.ImportEngine_PartCannotSetImport,
                                           ErrorId.ImportEngine_PartCannotSetImport, RetryMode.DoNotRetry, () =>
            {
                container.Compose(batch);
            });
        }
        public void Value_TwoDifferentValuesAsErrorsArgument_ShouldThrowComposition()
        {
            var errorIds1 = Expectations.GetEnumValues <CompositionErrorId>();
            var errorIds2 = Expectations.GetEnumValues <CompositionErrorId>();

            for (int i = 0; i < errorIds1.Count(); i++)
            {
                var errorId1 = errorIds1.ElementAt(i);
                var errorId2 = errorIds1.ElementAt(errorIds2.Count() - 1 - i);

                var result = CreateCompositionResult <string>(errorId1, errorId2);

                CompositionAssert.ThrowsErrors((ErrorId)errorId1, (ErrorId)errorId2, () =>
                {
                    var value = result.Value;
                });
            }
        }