public void SetUp()
        {
            theFinder = MockRepository.GenerateStub<INuspecTemplateFinder>();
            
            theSolution = new Solution();
            theSolution.AddProject("Project1");
            theSolution.AddProject("Project2");

            d1 = new NuspecDependencyToken("DependencyA", "1.0.0.0", VersionConstraint.DefaultFixed);
            d2 = new NuspecDependencyToken("DependencyB", "1.0.0.0", VersionConstraint.DefaultFixed);

            g1 = new NuspecTemplate(new NugetSpec("Spec1", "Spec1.nuspec"), new[] { ProjectNuspec.For(theSolution.FindProject("Project1")) });
            g2 = new NuspecTemplate(new NugetSpec("Spec2", "Spec2.nuspec"), new[] { ProjectNuspec.For(theSolution.FindProject("Project2")) });

            theTemplates = new NuspecTemplateCollection(new[] { g1, g2 });

            src1 = MockRepository.GenerateStub<INuspecDependencySource>();
            src2 = MockRepository.GenerateStub<INuspecDependencySource>();

            theFinder.Stub(x => x.Templates(theSolution)).Return(theTemplates);

            src1.Stub(x => x.DetermineDependencies(new NuspecTemplateContext(g1, theTemplates, theSolution))).Return(new[] { d1 });
            src1.Stub(x => x.DetermineDependencies(new NuspecTemplateContext(g2, theTemplates, theSolution))).Return(new NuspecDependencyToken[0]);

            src2.Stub(x => x.DetermineDependencies(new NuspecTemplateContext(g1, theTemplates, theSolution))).Return(new NuspecDependencyToken[0]);
            src2.Stub(x => x.DetermineDependencies(new NuspecTemplateContext(g2, theTemplates, theSolution))).Return(new[] { d2 });

            theGenerator = new NuspecGenerator(theFinder, new[] { src1, src2 });
            thePlan = theGenerator.PlanFor(theSolution, new SemanticVersion("1.0.0.0"));
        }
Пример #2
0
        public void SetUp()
        {
            theSolution = new Solution();
            p1 = theSolution.AddProject("MyProject");

            p1.AddDependency("Bottles");
            p1.AddDependency("FubuCore");
            p1.AddDependency("FubuLocalization");

            p2 = theSolution.AddProject("MyOtherProject");
            p2.AddDependency("FubuMVC.Core");

            theSolution.AddDependency(new Dependency("Bottles", "1.0.0.0", UpdateMode.Fixed));
            theSolution.AddDependency(new Dependency("FubuCore", "1.1.0.0", UpdateMode.Float));
            theSolution.AddDependency(new Dependency("FubuLocalization", "1.2.0.0", UpdateMode.Fixed));
            theSolution.AddDependency(new Dependency("FubuMVC.Core", "1.4.0.0", UpdateMode.Fixed));

            theNugetSpec = new NugetSpec("MyProject", "myproject.nuspec");

            theGroup = new NuspecTemplate(theNugetSpec, new[]
            {
                new ProjectNuspec(p1, new NugetSpec("MyProject", "MyProject.nuspec")), 
                new ProjectNuspec(p2, new NugetSpec("MyOtherProject", "MyOtherProject.nuspec"))
            });
        }
Пример #3
0
 public NuspecTemplateContext(NuspecTemplate current, NuspecTemplateCollection templates, Solution solution, SemanticVersion version)
 {
     Templates = templates;
     Version   = version;
     Solution  = solution;
     Current   = current;
 }
Пример #4
0
 public NuspecTemplateContext(NuspecTemplate current, NuspecTemplateCollection templates, Solution solution, SemanticVersion version)
 {
     Templates = templates;
     Version = version;
     Solution = solution;
     Current = current;
 }
        public void find_by_project_when_project_is_published_by_a_single_template()
        {
            var theProject = new ProjectNuspec(new Project("Project1"), new NugetSpec("test", "test"));

            var t1 = new NuspecTemplate(new NugetSpec("MySpec", "MySpec.nuspec"), new[] { theProject });

            var collection = new NuspecTemplateCollection();
            collection.Add(t1);

            collection.FindByProject(theProject.Project).ShouldBeTheSameAs(t1);
        }
        public void find_by_project_when_project_is_published_by_multiple_templates_returns_null()
        {
            var theProject = new ProjectNuspec(new Project("Project1"), new NugetSpec("test", "test"));

            var t1 = new NuspecTemplate(new NugetSpec("MySpec", "MySpec.nuspec"), new[] { theProject });
            var t2 = new NuspecTemplate(new NugetSpec("MySpec.Silverlight", "MySpec.Silverlight.nuspec"), new[] { theProject });

            var collection = new NuspecTemplateCollection();
            collection.Add(t1, t2);

            collection.FindByProject(theProject.Project).ShouldBeNull();
        }
 public string FindNuspecFile(NuspecTemplate template)
 {
     return(_templates[template]);
 }
Пример #8
0
 public NuspecPlan(NuspecTemplate template, SemanticVersion version)
 {
     _template = template;
     _version = version;
 }
Пример #9
0
 public NuspecPlan(NuspecTemplate template, SemanticVersion version)
 {
     _template = template;
     _version  = version;
 }
Пример #10
0
 protected bool Equals(NuspecTemplate other)
 {
     return(Id.Equals(other.Id));
 }
Пример #11
0
 public string FindNuspecFile(NuspecTemplate template)
 {
     return _templates[template];
 }
Пример #12
0
 public NuspecTemplateContext(NuspecTemplate current, NuspecTemplateCollection templates, Solution solution)
     : this(current, templates, solution, null)
 {
 }
Пример #13
0
 protected bool Equals(NuspecTemplate other)
 {
     return Id.Equals(other.Id);
 }
Пример #14
0
 public NuspecTemplateContext(NuspecTemplate current, NuspecTemplateCollection templates, Solution solution)
     : this(current, templates, solution, null)
 {
 }