public void EmptyProject(
            string projectPath,
            [Frozen] Mock <IProjectFileEnumeration> projectFileEnumeration,
            ArmTemplateEnumeration subject)
        {
            projectFileEnumeration.Setup(x => x.EnumerateProjectFiles(projectPath))
            .Returns(new List <string>());

            var armTemplatePaths = subject.EnumerateArmTemplatePaths(projectPath);

            armTemplatePaths.Should().BeEmpty();
        }
        public void FindJsonFileWithSchema(
            string projectPath,
            [Frozen] Mock <IProjectFileEnumeration> projectFileEnumeration,
            ArmTemplateEnumeration subject)
        {
            var directory       = GetTemporaryDirectory();
            var main            = Write(directory, "main.cs", "using System;");
            var armTemplatePath = Combine(directory, "other.json");

            Copy(BasicJsonPath, armTemplatePath);
            projectFileEnumeration.Setup(x => x.EnumerateProjectFiles(projectPath))
            .Returns(new[] { main, armTemplatePath });

            var armTemplatePaths = subject.EnumerateArmTemplatePaths(projectPath);

            armTemplatePaths.Should().Equal(armTemplatePath);
        }
        public void TwoAzureDeployJsonInSubdirectories(
            string projectPath,
            [Frozen] Mock <IProjectFileEnumeration> projectFileEnumeration,
            ArmTemplateEnumeration subject)
        {
            // Ensure case is ignored and subdirectories used
            var directory    = GetTemporaryDirectory();
            var azureDeploy1 = Write(directory, "sub1", "AzureDeploy.json", "{}");
            var azureDeploy2 = Write(directory, "sub1", "AZUREDEPLOY.JSON", "{}");

            projectFileEnumeration.Setup(x => x.EnumerateProjectFiles(projectPath))
            .Returns(new[] { azureDeploy1, azureDeploy2 });

            var armTemplatePaths = subject.EnumerateArmTemplatePaths(projectPath);

            armTemplatePaths.Should().Equal(azureDeploy1, azureDeploy2);
        }
        public void OneAzureDeployJson(
            string projectPath,
            [Frozen] Mock <IProjectFileEnumeration> projectFileEnumeration,
            ArmTemplateEnumeration subject)
        {
            var directory       = GetTemporaryDirectory();
            var main            = Write(directory, "main.cs", "using System;");
            var other           = Write(directory, "other.json", "{}");
            var azureDeployPath = Write(directory, "azuredeploy.json", "{}");

            projectFileEnumeration.Setup(x => x.EnumerateProjectFiles(projectPath))
            .Returns(new[] { main, other, azureDeployPath });

            var armTemplatePaths = subject.EnumerateArmTemplatePaths(projectPath);

            armTemplatePaths.Should().Equal(azureDeployPath);
        }
        public void OneAzureDeployJsonWithBasicSchema(
            string projectPath,
            [Frozen] Mock <IProjectFileEnumeration> projectFileEnumeration,
            ArmTemplateEnumeration subject)
        {
            // This makes sure we don't double-count azuredeploy.json files w/ the expected content
            var directory       = GetTemporaryDirectory();
            var other           = Write(directory, "other.json", "{}");
            var azureDeployPath = Combine(directory, "azuredeploy.json");

            Copy(BasicJsonPath, azureDeployPath);
            projectFileEnumeration.Setup(x => x.EnumerateProjectFiles(projectPath))
            .Returns(new[] { other, azureDeployPath });

            var armTemplatePaths = subject.EnumerateArmTemplatePaths(projectPath);

            armTemplatePaths.Should().Equal(azureDeployPath);
        }