Exemplo n.º 1
0
        public async Task WordPressDockerComposeServiceShallShowInstallScreen()
        {
            var file = Path.Combine(Directory.GetCurrentDirectory(),
                                    (TemplateString)"Resources/ComposeTests/WordPress/docker-compose.yml");

            using (var svc = new DockerComposeCompositeService(DockerHost, new DockerComposeConfig
            {
                ComposeFilePath = new List <string> {
                    file
                },
                ForceRecreate = true,
                RemoveOrphans = true,
                StopOnDispose = true
            }))
            {
                svc.Start();

                svc.Containers.First(x => x.Name == "wordpress").WaitForHttp("http://localhost:8000/wp-admin/install.php");

                // We now have a running WordPress with a MySql database
                var installPage = await $"http://localhost:8000/wp-admin/install.php".Wget();

                Assert.IsTrue(installPage.IndexOf("https://wordpress.org/", StringComparison.Ordinal) != -1);
            }
        }
Exemplo n.º 2
0
        public void StartErrorMessageShallContainDockerComposeFilePaths(string[] nonExistentComposeFiles)
        {
            var svc = new DockerComposeCompositeService(DockerHost, new DockerComposeConfig
            {
                ComposeFilePath = new List <string>(nonExistentComposeFiles),
                ForceRecreate   = true,
                RemoveOrphans   = true,
                StopOnDispose   = true
            });

            var ex = Assert.ThrowsException <FluentDockerException>(() => svc.Start());

            foreach (var nonExistentComposeFile in nonExistentComposeFiles)
            {
                Assert.IsTrue(ex.Message.Contains(nonExistentComposeFile));
            }
        }
Exemplo n.º 3
0
 public void Up()
 {
     _dockerSetup.Start();
 }