Beispiel #1
0
        public void has_dependency_negative()
        {
            var group = new DependencyGroup();
            group.Dependencies.Add(new GroupedDependency("FubuCore"));

            group.Has("Bottles").ShouldBeFalse();
        }
Beispiel #2
0
        public void has_dependency_positive()
        {
            var group = new DependencyGroup();
            group.Dependencies.Add(new GroupedDependency("FubuCore"));

            group.Has("FubuCore").ShouldBeTrue();
        }
Beispiel #3
0
        public void persists_and_retrieves_the_solution()
        {
            var solution = new Solution
            {
                Name = "Test",
                BuildCommand = "rake",
                FastBuildCommand = "rake compile",
                Feeds = new[] { Feed.NuGetV2, Feed.NuGetV1 },
                Nugets = new[] { new Dependency("FubuCore", "1.0.1.0") }
            };

            var group = new DependencyGroup();
            group.Dependencies.Add(new GroupedDependency("FubuCore"));
            solution.Groups.Add(group);

            var constrainedDependency = new Dependency("Bottles", "1.0.0.0")
            {
                VersionConstraint = VersionConstraint.DefaultFloat
            };
            solution.AddDependency(constrainedDependency);

            solution.Nuspecs.Add(new NuspecMap { File = "Temp", Project = "Test"});

            CheckXmlPersistence.For(solution);
        }
Beispiel #4
0
        public void requests_for_a_single_dependency_in_multiple_groups()
        {
            var g1 = new DependencyGroup();
            g1.Dependencies.Add(new GroupedDependency("FubuCore"));
            g1.Dependencies.Add(new GroupedDependency("FubuLocalization"));
            theSolution.Groups.Add(g1);

            var g2 = new DependencyGroup();
            g2.Dependencies.Add(new GroupedDependency("FubuLocalization"));
            g2.Dependencies.Add(new GroupedDependency("Bottles"));
            theSolution.Groups.Add(g2);

            theInput.NugetFlag = "FubuCore";

            var requests = theInput.Requests(theSolution).ToArray();

            requests[0].Dependency.ShouldEqual(new Dependency("FubuCore"));
            requests[0].Batched.ShouldBeFalse();

            requests[1].Dependency.ShouldEqual(new Dependency("FubuLocalization"));
            requests[1].Batched.ShouldBeFalse();

            requests[2].Dependency.ShouldEqual(new Dependency("Bottles"));
            requests[2].Batched.ShouldBeFalse();
        }
        public void has_dependency_case_insensitive()
        {
            var group = new DependencyGroup();
            group.Add(new GroupedDependency("FubuCore"));

            group.Has("fubuCore").ShouldBeTrue();
        }
        public void requests_for_a_single_dependency_in_a_group()
        {
            var group = new DependencyGroup();
            group.Add(new GroupedDependency("FubuCore"));
            group.Add(new GroupedDependency("FubuLocalization"));

            theSolution.AddGroup(group);
            theInput.NugetFlag = "FubuCore";

            var requests = theInput.Requests(theSolution).ToArray();

            requests[0].Dependency.ShouldEqual(new Dependency("FubuCore"));
            requests[0].Batched.ShouldBeFalse();

            requests[1].Dependency.ShouldEqual(new Dependency("FubuLocalization"));
            requests[1].Batched.ShouldBeFalse();
        }
        public void persists_and_retrieves_the_solution()
        {
            var solution = new Solution
            {
                Name = "Test",
                Feeds = new[] { Feed.NuGetV2, Feed.NuGetV1 },
                Nugets = new[] { new Dependency("FubuCore", "1.0.1.0") }
            };

            var group = new DependencyGroup { Name = "Test"};
            group.Add(new GroupedDependency("FubuCore"));
            solution.AddGroup(group);

            solution.AddDependency(new Dependency("Bottles", "1.0.0.0")
            {
                VersionConstraint = VersionConstraint.DefaultFloat
            });

            solution.AddNuspec(new NuspecMap { PackageId = "Temp", PublishedBy = "Test" });

            solution.Ignore("Rhino.ServiceBus.dll", "Esent.Interop.dll");

            var registry = new RippleBlockRegistry();
            var solutionSettings = registry.SettingsFor(typeof (Solution));

            CheckObjectBlockPersistence
                .ForSolution(solution)
                .VerifyProperties(property =>
                {
                    if (!property.CanWrite)
                        return false;

                    if (solutionSettings.ShouldIgnore(solution, new SingleProperty(property)))
                        return false;

                    return true;
                });
        }
Beispiel #8
0
 public void AddGroup(DependencyGroup group)
 {
     _groups.Add(group);
 }
Beispiel #9
0
            public void GroupDependencies(params string[] dependencies)
            {
                Modify(solution =>
                {
                    var group = new DependencyGroup();
                    dependencies.Each(x => group.Dependencies.Add(new GroupedDependency(x)));

                    solution.Groups.Add(group);
                });
            }
Beispiel #10
0
 public void AddGroup(DependencyGroup group)
 {
     _groups.Add(group);
 }
Beispiel #11
0
 protected bool Equals(DependencyGroup other)
 {
     return(_dependencies.SequenceEqual(other._dependencies) && string.Equals(Name, other.Name));
 }
Beispiel #12
0
            public void GroupDependencies(params string[] dependencies)
            {
                Modify(solution =>
                {
                    var group = new DependencyGroup { Name = dependencies.First() };
                    dependencies.Each(x => group.Add(new GroupedDependency(x)));

                    solution.AddGroup(group);
                });
            }
Beispiel #13
0
 protected bool Equals(DependencyGroup other)
 {
     return _dependencies.SequenceEqual(other._dependencies) && string.Equals(Name, other.Name);
 }