예제 #1
0
    public void ShouldNotCreateAssemblyInfoFileWhenNotExistsAndNotEnsureAssemblyInfo(string fileExtension)
    {
        var fileSystem       = new TestFileSystem();
        var workingDir       = Path.GetTempPath();
        var assemblyInfoFile = "VersionAssemblyInfo." + fileExtension;
        var fullPath         = Path.Combine(workingDir, assemblyInfoFile);
        var variables        = VariableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", "v"), new TestEffectiveConfiguration(), false);

        using (var assemblyInfoFileUpdater = new AssemblyInfoFileUpdater(assemblyInfoFile, workingDir, variables, fileSystem, false))
        {
            assemblyInfoFileUpdater.Update();

            fileSystem.Exists(fullPath).ShouldBeFalse();
        }
    }
예제 #2
0
    public void ShouldNotCreateCSharpAssemblyInfoFileWhenNotExistsAndNotEnsureAssemblyInfo()
    {
        var           fileSystem       = new TestFileSystem();
        var           workingDir       = Path.GetTempPath();
        ISet <string> assemblyInfoFile = new HashSet <string> {
            "VersionAssemblyInfo.cs"
        };
        var fullPath = Path.Combine(workingDir, assemblyInfoFile.First());

        var variables = VariableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", "v"), new TestEffectiveConfiguration(), false);

        using (new AssemblyInfoFileUpdate(new Arguments {
            UpdateAssemblyInfo = true, UpdateAssemblyInfoFileName = assemblyInfoFile
        }, workingDir, variables, fileSystem))
        {
            fileSystem.Exists(fullPath).ShouldBeFalse();
        }
    }
    public void ShouldNotCreateAssemblyInfoFileWhenNotExistsAndNotEnsureAssemblyInfo(string fileExtension)
    {
        var fileSystem = new TestFileSystem();
        var workingDir = Path.GetTempPath();
        var assemblyInfoFile = new HashSet<string>
        {
            "VersionAssemblyInfo." + fileExtension
        };
        var fullPath = Path.Combine(workingDir, assemblyInfoFile.First());
        var variables = VariableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", "v"), new TestEffectiveConfiguration(), false);
        var arguments = new Arguments
        {
            UpdateAssemblyInfo = true,
            UpdateAssemblyInfoFileName = assemblyInfoFile
        };

        using (new AssemblyInfoFileUpdate(arguments, workingDir, variables, fileSystem))
        {
            fileSystem.Exists(fullPath).ShouldBeFalse();
        }
    }
    public void ShouldNotCreateCSharpAssemblyInfoFileWhenNotExistsAndNotEnsureAssemblyInfo()
    {
        var fileSystem = new TestFileSystem();
        const string workingDir = "C:\\Testing";
        ISet<string> assemblyInfoFile = new HashSet<string> { "VersionAssemblyInfo.cs" };
        var fullPath = Path.Combine(workingDir, assemblyInfoFile.First());

        var variables = VariableProvider.GetVariablesFor(SemanticVersion.Parse("1.0.0", "v"), new TestEffectiveConfiguration(), false);
        using (new AssemblyInfoFileUpdate(new Arguments { UpdateAssemblyInfo = true, UpdateAssemblyInfoFileName = assemblyInfoFile }, workingDir, variables, fileSystem))
        {
            fileSystem.Exists(fullPath).ShouldBeFalse();
        }
    }