Exemplo n.º 1
0
        public static IComposableCustomizationOptions Compose <T>(this IComposableCustomizationOptions options) where T : ICustomization
        {
            options = options ?? throw new ArgumentNullException(nameof(options));

            options.Customizations.Add(Activator.CreateInstance <T>());

            return(options);
        }
Exemplo n.º 2
0
        public static IComposableCustomizationOptions Compose <T>(this IComposableCustomizationOptions options, Func <ICustomizationComposer <T>, ISpecimenBuilder> composerTransformation)
        {
            options = options ?? throw new ArgumentNullException(nameof(options));

            composerTransformation = composerTransformation ?? throw new ArgumentNullException(nameof(composerTransformation));

            options.Customizations.Add(new ComposeCustomization <T>(composerTransformation));

            return(options);
        }
Exemplo n.º 3
0
        public static T Create <T>(this IComposableCustomizationOptions options) where T : new()
        {
            options = options ?? throw new ArgumentNullException(nameof(options));

            return(options.Compose().Create <T>());
        }