public void ExecuteFeatureWillCloneElkRepository() { var path = CleanFolder("repo-here"); var feature = new ElkFeature(); try { feature.Initialize(new Dictionary <string, object> { { ElkFeature.TargetPath, "repo-here" } }); feature.Execute(); IsTrue(Directory.Exists(path)); IsTrue(Directory.GetFiles(path).Any(x => x.EndsWith("docker-compose.yml"))); feature.Dispose(); CleanFolder("repo-here"); } catch { feature.Dispose(); CleanFolder("repo-here"); throw; } }
public void KeepOnDisposeWillKeepClonedRepo() { var feature = new ElkFeature(); try { feature.Initialize(new Dictionary <string, object> { { FeatureConstants.KeepOnDispose, "true" } }); feature.Execute(); feature.Dispose(); IsTrue(Directory.Exists(feature.Target)); IsTrue(Directory.GetFiles(feature.Target).Any(x => x.EndsWith("docker-compose.yml"))); feature.Services.OfType <ICompositeService>().First().Dispose(); CleanFolder(Path.GetFileName(feature.Target)); IsFalse(Directory.Exists(feature.Target)); } catch { try { feature.Services.OfType <ICompositeService>().First().Dispose(); } catch { /*ignore*/ } CleanFolder(Path.GetFileName(feature.Target)); throw; } }
public void DisposeDeletesAllContent() { var feature = new ElkFeature(); try { feature.Initialize(); feature.Execute(); IsTrue(Directory.Exists(feature.Target)); IsTrue(Directory.GetFiles(feature.Target).Any(x => x.EndsWith("docker-compose.yml"))); feature.Dispose(); IsFalse(Directory.Exists(feature.Target)); } catch { feature.Dispose(); throw; } }
public void IfNoTargetPathIsSetARandomIsChosen() { var feature = new ElkFeature(); try { feature.Initialize(); feature.Execute(); IsTrue(Directory.Exists(feature.Target)); IsTrue(Directory.GetFiles(feature.Target).Any(x => x.EndsWith("docker-compose.yml"))); feature.Dispose(); CleanFolder(Path.GetFileName(feature.Target)); } catch { feature.Dispose(); CleanFolder(Path.GetFileName(feature.Target)); throw; } }