public async Task SingleTfm()
        {
            _tempDir
            .SubDir("src")
            .SubDir("Project1")
            .WithCSharpProject("Project1", out var target)
            .WithTargetFrameworks("netcoreapp1.0")
            .Dir()
            .WithFile("Program.cs")
            .WithFile("Class1.cs")
            .SubDir("obj").WithFile("ignored.cs").Up()
            .SubDir("Properties").WithFile("Strings.resx").Up()
            .Up()
            .Up()
            .Create();

            var fileset = await GetFileSet(target);

            AssertEx.EqualFileList(
                _tempDir.Root,
                new[]
            {
                "src/Project1/Project1.csproj",
                "src/Project1/Program.cs",
                "src/Project1/Class1.cs",
                "src/Project1/Properties/Strings.resx",
            },
                fileset
                );
        }
Ejemplo n.º 2
0
 public TemporaryCSharpProject GetOrCreate(string projectName)
 {
     if (!_projects.TryGetValue(projectName, out TemporaryCSharpProject sourceProj))
     {
         sourceProj = _directory.SubDir(projectName).WithCSharpProject(projectName);
         _onCreate?.Invoke(sourceProj);
         _projects.Add(projectName, sourceProj);
     }
     return(sourceProj);
 }