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"); }
public void Should_Set_CdnProvider(CdnProvider provider) { // Given var settings = new LibManCacheCleanSettings(); // When settings.WithProvider(provider); // Then settings.Provider.ShouldBe(provider); }
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"); }
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); }
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); }