Exemplo n.º 1
0
            public void Should_Throw_If_CdnProvider_Is_Filesystem()
            {
                // Given
                var settings = new LibManCacheCleanSettings();

                // When
                var result = Record.Exception(() => settings.WithProvider(CdnProvider.filesystem));

                // Then
                result.IsArgumentException("provider");
            }
Exemplo n.º 2
0
            public void Should_Set_CdnProvider(CdnProvider provider)
            {
                // Given
                var settings = new LibManCacheCleanSettings();

                // When
                settings.WithProvider(provider);

                // Then
                settings.Provider.ShouldBe(provider);
            }
Exemplo n.º 3
0
            public void Should_Throw_If_Settings_Are_Null()
            {
                // Given
                LibManCacheCleanSettings settings = null;

                // When
                var result = Record.Exception(() => settings.WithProvider(CdnProvider.Default));

                // Then
                result.IsArgumentNullException("settings");
            }
Exemplo n.º 4
0
        public static void LibManCacheClean(this ICakeContext context, LibManCacheCleanSettings settings)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            if (settings == null)
            {
                throw new ArgumentNullException(nameof(settings));
            }

            LibManAddinInformation.LogVersionInformation(context.Log);
            var tool = new LibManCacheCleanTool(context.FileSystem, context.Environment, context.ProcessRunner, context.Tools, context.Log);

            tool.CacheClean(settings);
        }
Exemplo n.º 5
0
        public static void LibManCacheClean(this ICakeContext context, Action <LibManCacheCleanSettings> configurator)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            if (configurator == null)
            {
                throw new ArgumentNullException(nameof(configurator));
            }

            var settings = new LibManCacheCleanSettings();

            configurator(settings);
            context.LibManCacheClean(settings);
        }