Skip to content

Commit

Permalink
Replaced calls to obsolete create project methods with the ProjectCre…
Browse files Browse the repository at this point in the history
…ator #84
  • Loading branch information
mtscout6 committed Mar 19, 2014
1 parent 9cca0c2 commit 743e0ab
Show file tree
Hide file tree
Showing 19 changed files with 138 additions and 121 deletions.
9 changes: 5 additions & 4 deletions src/FubuCsProjFile.Testing/ContentTester.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using FubuCsProjFile.ProjectFiles.CsProj;
using FubuCsProjFile.ProjectFiles;
using FubuCsProjFile.ProjectFiles.CsProj;
using FubuTestingSupport;
using NUnit.Framework;

Expand All @@ -17,7 +18,7 @@ public void default_copy_to_behavior_is_never()
[Test]
public void can_add_and_load_never_copy_content()
{
var project = CsProjFile.CreateAtSolutionDirectory("MyProj", "myproj");
var project = ProjectCreator.CreateAtSolutionDirectory("MyProj", "myproj", ProjectType.CsProj);
var content = new Content("Something.txt")
{
CopyToOutputDirectory = ContentCopy.Never
Expand All @@ -35,7 +36,7 @@ public void can_add_and_load_never_copy_content()
[Test]
public void can_add_and_load_always_copy_content()
{
var project = CsProjFile.CreateAtSolutionDirectory("MyProj", "myproj");
var project = ProjectCreator.CreateAtSolutionDirectory("MyProj", "myproj", ProjectType.CsProj);
var content = new Content("Something.txt")
{
CopyToOutputDirectory = ContentCopy.Always
Expand All @@ -55,7 +56,7 @@ public void can_add_and_load_always_copy_content()
public void can_add_and_load_IfNewer_copy_content()
{
// SAMPLE: adding-content-to-csprojfile
var project = CsProjFile.CreateAtSolutionDirectory("MyProj", "myproj");
var project = ProjectCreator.CreateAtSolutionDirectory("MyProj", "myproj", ProjectType.CsProj);
var content = new Content("Something.txt")
{
CopyToOutputDirectory = ContentCopy.IfNewer
Expand Down
26 changes: 12 additions & 14 deletions src/FubuCsProjFile.Testing/CsProjFileTester.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Diagnostics;
using System.IO;
using FubuCore;
using FubuCsProjFile.MSBuild;
using FubuCsProjFile.ProjectFiles.CsProj;
Expand Down Expand Up @@ -35,15 +33,15 @@ public void SetUp()
[Test]
public void creating_a_new_csprojfile_relative_to_a_solution_directory_creates_a_guid()
{
var project = CsProjFile.CreateAtSolutionDirectory("Foo", "myproj");
var project = new CsProjCreator().CreateAtSolutionDirectory("Foo", "myproj");
project.ProjectGuid.ShouldNotEqual(Guid.Empty);

}

[Test]
public void creating_a_new_csprojectfile_create_a_guid()
{
var project = CsProjFile.CreateAtLocation("Foo.AssemblyName.csproj", "Foo.AssemblyName");
var project = new CsProjCreator().CreateAtLocation("Foo.AssemblyName.csproj", "Foo.AssemblyName");
project.ProjectGuid.ShouldNotEqual(Guid.Empty);
}

Expand All @@ -70,7 +68,7 @@ public void write_and_then_read_the_dot_net_version_from_csprojfile()
[Test]
public void creating_a_new_csprojfile_class_library_is_default()
{
var project = CsProjFile.CreateAtSolutionDirectory("Foo", "myproj");
var project = new CsProjCreator().CreateAtSolutionDirectory("Foo", "myproj");
project.ProjectTypes().Single().ShouldEqual(Guid.Parse("FAE04EC0-301F-11D3-BF4B-00C04F79EFBC"));

}
Expand All @@ -92,7 +90,7 @@ public void read_the_project_name()
[Test]
public void sets_the_assembly_name_and_root_namespace_on_creation()
{
var project = CsProjFile.CreateAtSolutionDirectory("Goofy", "Directory");
var project = new CsProjCreator().CreateAtSolutionDirectory("Goofy", "Directory");
project.RootNamespace.ShouldEqual("Goofy");
project.AssemblyName.ShouldEqual("Goofy");

Expand All @@ -116,7 +114,7 @@ public void read_project_type_as_a_class_library_if_no_explicit_project_type()
[Test]
public void remove_code_file()
{
var project = CsProjFile.CreateAtSolutionDirectory("MyProj", "myproj");
var project = new CsProjCreator().CreateAtSolutionDirectory("MyProj", "myproj");
project.Add<CodeFile>("foo.cs");
project.Add<CodeFile>("bar.cs");

Expand All @@ -140,7 +138,7 @@ public void remove_code_file()
[Test]
public void remove_code_file_2()
{
var project = CsProjFile.CreateAtSolutionDirectory("MyProj", "myproj");
var project = new CsProjCreator().CreateAtSolutionDirectory("MyProj", "myproj");
project.Add<CodeFile>("foo.cs");
project.Add<CodeFile>("bar.cs");

Expand Down Expand Up @@ -168,7 +166,7 @@ public void add_code_files()
fileSystem.WriteStringToFile("myproj".AppendPath("foo.cs"), "using System.Web;");
fileSystem.WriteStringToFile("myproj".AppendPath("bar.cs"), "using System.Web;");

var project = CsProjFile.CreateAtSolutionDirectory("MyProj", "myproj");
var project = new CsProjCreator().CreateAtSolutionDirectory("MyProj", "myproj");
project.Add<CodeFile>("foo.cs");
project.Add<CodeFile>("bar.cs");

Expand Down Expand Up @@ -196,7 +194,7 @@ public void adding_items_is_idempotent()
fileSystem.WriteStringToFile("myproj".AppendPath("foo.cs"), "using System.Web;");
fileSystem.WriteStringToFile("myproj".AppendPath("bar.cs"), "using System.Web;");

var project = CsProjFile.CreateAtSolutionDirectory("MyProj", "myproj");
var project = new CsProjCreator().CreateAtSolutionDirectory("MyProj", "myproj");
project.Add<CodeFile>("foo.cs");
project.Add<CodeFile>("bar.cs");

Expand Down Expand Up @@ -235,7 +233,7 @@ public void can_write_embedded_resources()
fileSystem.WriteStringToFile("myproj".AppendPath("foo.txt"), "using System.Web;");
fileSystem.WriteStringToFile("myproj".AppendPath("bar.txt"), "using System.Web;");

var project = CsProjFile.CreateAtSolutionDirectory("MyProj", "myproj");
var project = new CsProjCreator().CreateAtSolutionDirectory("MyProj", "myproj");
project.Add<EmbeddedResource>("foo.txt");
project.Add<EmbeddedResource>("bar.txt");

Expand Down Expand Up @@ -427,7 +425,7 @@ public void can_read_then_change_and_save_a_projecet_reference_item()
[Test]
public void can_write_system_assemblies()
{
var project = CsProjFile.CreateAtSolutionDirectory("MyProj", "myproj");
var project = new CsProjCreator().CreateAtSolutionDirectory("MyProj", "myproj");
project.Add<AssemblyReference>("System.Configuration");
project.Add<AssemblyReference>("System.Security");

Expand All @@ -444,7 +442,7 @@ public void can_write_system_assemblies()
public void can_write_assembly_reference_with_hint_path()
{
var hintPath = @"..\packages\RhinoMocks\lib\net\Rhino.Mocks.dll";
var project = CsProjFile.CreateAtSolutionDirectory("MyProj", "myproj");
var project = new CsProjCreator().CreateAtSolutionDirectory("MyProj", "myproj");
project.Add(new AssemblyReference("Rhino.Mocks", hintPath));

project.Save();
Expand All @@ -464,7 +462,7 @@ public void can_write_and_read_project_references()
var include = @"..\OtherProject\OtherProject.csproj";


var project = CsProjFile.CreateAtSolutionDirectory("MyProj", "myproj");
var project = new CsProjCreator().CreateAtSolutionDirectory("MyProj", "myproj");
var reference1 = new ProjectReference(include)
{
ProjectName = "OtherProject",
Expand Down
5 changes: 3 additions & 2 deletions src/FubuCsProjFile.Testing/NoneTester.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using FubuCsProjFile.ProjectFiles.CsProj;
using FubuCsProjFile.ProjectFiles;
using FubuCsProjFile.ProjectFiles.CsProj;
using FubuTestingSupport;
using NUnit.Framework;

Expand All @@ -10,7 +11,7 @@ public class NoneTester
[Test]
public void can_add_a_file_with_build_action_none()
{
var project = CsProjFile.CreateAtSolutionDirectory("MyProj", "myproj");
var project = ProjectCreator.CreateAtSolutionDirectory("MyProj", "myproj", ProjectType.CsProj);
var content = new None("packages.config");

project.Add(content);
Expand Down
21 changes: 11 additions & 10 deletions src/FubuCsProjFile.Testing/Templating/AssemblyReferenceTester.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Diagnostics;
using FubuCsProjFile.ProjectFiles;
using FubuCsProjFile.ProjectFiles.CsProj;
using FubuCsProjFile.Templating.Planning;
using FubuCsProjFile.Templating.Runtime;
Expand Down Expand Up @@ -36,7 +37,7 @@ public void can_write_assembly_reference_to_a_project()
public void adding_an_assembly_reference()
{
// SAMPLE: assembly-reference
var project = CsProjFile.CreateAtLocation("MyProject.csproj", "MyProject");
var project = ProjectCreator.CreateAtLocation("MyProject.csproj", "MyProject", ProjectType.CsProj);
project.Add(new AssemblyReference("MyOtherLibrary")
{
HintPath = "../packages/MyOtherLibrary/lib/MyOtherLibrary.dll",
Expand Down Expand Up @@ -66,7 +67,7 @@ public void adding_an_assembly_reference()
[Test]
public void can_write_and_read_fusion_name()
{
var project = CsProjFile.CreateAtLocation("Foo.csproj", "Foo");
var project = ProjectCreator.CreateAtLocation("Foo.csproj", "Foo", ProjectType.CsProj);
var assemblyReference = new AssemblyReference("Foo")
{
FusionName = "some fusion"
Expand All @@ -85,7 +86,7 @@ public void can_write_and_read_fusion_name()
[Test]
public void can_write_and_read_Aliases()
{
var project = CsProjFile.CreateAtLocation("Foo.csproj", "Foo");
var project = ProjectCreator.CreateAtLocation("Foo.csproj", "Foo", ProjectType.CsProj);
var assemblyReference = new AssemblyReference("Foo")
{
Aliases = "some alias"
Expand All @@ -104,7 +105,7 @@ public void can_write_and_read_Aliases()
[Test]
public void can_write_and_read_display_name()
{
var project = CsProjFile.CreateAtLocation("Foo.csproj", "Foo");
var project = ProjectCreator.CreateAtLocation("Foo.csproj", "Foo", ProjectType.CsProj);
var assemblyReference = new AssemblyReference("Foo")
{
DisplayName = "some name"
Expand All @@ -123,7 +124,7 @@ public void can_write_and_read_display_name()
[Test]
public void can_write_and_read_SpecificVersion_true()
{
var project = CsProjFile.CreateAtLocation("Foo.csproj", "Foo");
var project = ProjectCreator.CreateAtLocation("Foo.csproj", "Foo", ProjectType.CsProj);
var assemblyReference = new AssemblyReference("Foo")
{
SpecificVersion = true
Expand All @@ -142,7 +143,7 @@ public void can_write_and_read_SpecificVersion_true()
[Test]
public void can_write_and_read_SpecificVersion_false()
{
var project = CsProjFile.CreateAtLocation("Foo.csproj", "Foo");
var project = ProjectCreator.CreateAtLocation("Foo.csproj", "Foo", ProjectType.CsProj);
var assemblyReference = new AssemblyReference("Foo")
{
SpecificVersion = false
Expand All @@ -161,7 +162,7 @@ public void can_write_and_read_SpecificVersion_false()
[Test]
public void can_write_and_read_SpecificVersion_null()
{
var project = CsProjFile.CreateAtLocation("Foo.csproj", "Foo");
var project = ProjectCreator.CreateAtLocation("Foo.csproj", "Foo", ProjectType.CsProj);
var assemblyReference = new AssemblyReference("Foo")
{
SpecificVersion = null
Expand All @@ -181,7 +182,7 @@ public void can_write_and_read_SpecificVersion_null()
[Test]
public void can_write_and_read_Private_true()
{
var project = CsProjFile.CreateAtLocation("Foo.csproj", "Foo");
var project = ProjectCreator.CreateAtLocation("Foo.csproj", "Foo", ProjectType.CsProj);
var assemblyReference = new AssemblyReference("Foo")
{
Private = true
Expand All @@ -200,7 +201,7 @@ public void can_write_and_read_Private_true()
[Test]
public void can_write_and_read_Private_false()
{
var project = CsProjFile.CreateAtLocation("Foo.csproj", "Foo");
var project = ProjectCreator.CreateAtLocation("Foo.csproj", "Foo", ProjectType.CsProj);
var assemblyReference = new AssemblyReference("Foo")
{
Private = false
Expand All @@ -219,7 +220,7 @@ public void can_write_and_read_Private_false()
[Test]
public void can_write_and_read_Private_null()
{
var project = CsProjFile.CreateAtLocation("Foo.csproj", "Foo");
var project = ProjectCreator.CreateAtLocation("Foo.csproj", "Foo", ProjectType.CsProj);
var assemblyReference = new AssemblyReference("Foo")
{
Private = null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.IO;
using FubuCore;
using FubuCsProjFile.ProjectFiles.CsProj;
using FubuCsProjFile.Templating;
using FubuCsProjFile.ProjectFiles;
using FubuCsProjFile.Templating.Runtime;
using NUnit.Framework;
using FubuTestingSupport;
Expand All @@ -12,7 +11,7 @@ namespace FubuCsProjFile.Testing.Templating
[TestFixture]
public class CodeFileTemplateTester
{
private CsProjFile theProject;
private IProjectFile theProject;
private ProjectPlan thePlan;

[TestFixtureSetUp]
Expand All @@ -21,7 +20,7 @@ public void SetUp()
new FileSystem().DeleteDirectory("Templated");
new FileSystem().CreateDirectory("Templated");

theProject = CsProjFile.CreateAtSolutionDirectory("TemplatedProject", "Templated");
theProject = ProjectCreator.CreateAtSolutionDirectory("TemplatedProject", "Templated", ProjectType.CsProj);
thePlan = new ProjectPlan(theProject.ProjectName);
}

Expand Down
3 changes: 2 additions & 1 deletion src/FubuCsProjFile.Testing/Templating/CodeFileTester.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using FubuCsProjFile.ProjectFiles;
using FubuCsProjFile.ProjectFiles.CsProj;
using NUnit.Framework;
using FubuTestingSupport;
Expand All @@ -12,7 +13,7 @@ public class CodeFileTester
[Test]
public void read_and_write_with_a_link()
{
var project = CsProjFile.CreateAtSolutionDirectory("Foo", Guid.NewGuid().ToString());
var project = ProjectCreator.CreateAtSolutionDirectory("Foo", Guid.NewGuid().ToString(), ProjectType.CsProj);

var file = new CodeFile("..\\CommonAssemblyInfo.cs") {Link = "CommonAssemblyInfo.cs"};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
using System.Diagnostics;
using System.IO;
using FubuCsProjFile.ProjectFiles.CsProj;
using FubuCsProjFile.Templating;
using System.IO;
using FubuCsProjFile.ProjectFiles;
using FubuCsProjFile.Templating.Planning;
using FubuCsProjFile.Templating.Runtime;
using NUnit.Framework;
using FubuCore;
using FubuTestingSupport;
using System.Linq;
using System.Collections.Generic;

namespace FubuCsProjFile.Testing.Templating
{
[TestFixture]
public class CopyProjectReferencesTester
{
private TemplatePlan thePlan;
private CsProjFile theOriginalProject;
private CsProjFile theTestingProject;
private IProjectFile theOriginalProject;
private IProjectFile theTestingProject;
private ProjectPlan testingPlan;

[SetUp]
Expand Down
12 changes: 4 additions & 8 deletions src/FubuCsProjFile.Testing/Templating/ProjectDirectoryTester.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using System.IO;
using System.Linq;
using System.Linq;
using FubuCore;
using FubuCsProjFile.ProjectFiles.CsProj;
using FubuCsProjFile.Templating;
using FubuCsProjFile.ProjectFiles;
using FubuCsProjFile.Templating.Graph;
using FubuCsProjFile.Templating.Runtime;
using FubuTestingSupport;
Expand All @@ -13,17 +11,15 @@ namespace FubuCsProjFile.Testing.Templating
[TestFixture]
public class ProjectDirectoryTester
{
private CsProjFile csProjFile;
private IProjectFile csProjFile;

[SetUp]
public void SetUp()
{
TemplateLibrary.FileSystem.DeleteDirectory("temp-solution");
TemplateLibrary.FileSystem.CreateDirectory("temp-solution");

csProjFile = CsProjFile.CreateAtSolutionDirectory("MyProj", "temp-solution");


csProjFile = ProjectCreator.CreateAtSolutionDirectory("MyProj", "temp-solution", ProjectType.CsProj);
}

[Test]
Expand Down
Loading

0 comments on commit 743e0ab

Please sign in to comment.