Пример #1
0
 public void AddDependencyGroup()
 {
     var dependencyGroup = new DependencyGroup();
     var nuGetOptionals = _subject.AddDependencyGroup(dependencyGroup);
     Assert.That(nuGetOptionals, Is.EqualTo(_subject));
     Assert.That(_parent._depenencyGroups[0], Is.EqualTo(dependencyGroup));
 }
Пример #2
0
        public void ShouldGenerateXmlWithoutFramwork()
        {
            var subject = new DependencyGroup();

            subject.Add("Project1");
            Assert.That(subject.ToString(), Is.EqualTo(string.Format("<group>{0}<dependency id=\"{1}\" />{0}</group>{0}", Environment.NewLine, "Project1")));
        }
Пример #3
0
 public void ShouldGenerateXmlWithFramwork()
 {
     var subject = new DependencyGroup();
     subject.Framework = "net40";
     subject.Add("Project1");
     Assert.That(subject.ToString(), Is.EqualTo(string.Format("<group targetFramework=\"{1}\">{0}<dependency id=\"{2}\" />{0}</group>{0}", Environment.NewLine, subject.Framework, "Project1")));
 }
Пример #4
0
        public void ShouldAddWithVersion()
        {
            var subject = new DependencyGroup();

            subject.Add("Project1", "[1,3)");
            Assert.That(subject.Depenencies.Count, Is.EqualTo(1));
        }
Пример #5
0
        public void AddDependencyGroup()
        {
            var dependencyGroup = new DependencyGroup();
            var nuGetOptionals  = _subject.AddDependencyGroup(dependencyGroup);

            Assert.That(nuGetOptionals, Is.EqualTo(_subject));
            Assert.That(_parent._depenencyGroups[0], Is.EqualTo(dependencyGroup));
        }
        public void XML_TestDepenencyGroup()
        {
            var dependencyGroup = new DependencyGroup();

            dependencyGroup.Add("SampleProject");
            _nuGetOptionals.AddDependencyGroup(dependencyGroup);
            var schema      = _subject.CreateSchema();
            var xdoc        = XDocument.Parse(schema);
            var ns          = xdoc.Root.Name.Namespace;
            var depenencies = xdoc.Element(ns + "package").Element(ns + "metadata").Element(ns + "dependencies");

            Assert.That(depenencies, Is.Not.Null);
            Assert.That(depenencies.Nodes().Count(), Is.EqualTo(1));
        }
Пример #7
0
 public void ShouldAddWithVersion()
 {
     var subject = new DependencyGroup();
     subject.Add("Project1", "[1,3)");
     Assert.That(subject.Depenencies.Count, Is.EqualTo(1));
 }
Пример #8
0
 public NuGetOptionals AddDependencyGroup(DependencyGroup dependencyGroup)
 {
     _parent._depenencyGroups.Add(dependencyGroup);
     return(this);
 }
Пример #9
0
 public NuGetOptionals AddDependencyGroup(DependencyGroup dependencyGroup)
 {
     _parent._depenencyGroups.Add(dependencyGroup);
     return this;
 }
Пример #10
0
 public void XML_TestDepenencyGroup()
 {
     var dependencyGroup = new DependencyGroup();
     dependencyGroup.Add("SampleProject");
     _nuGetOptionals.AddDependencyGroup(dependencyGroup);
     var schema = _subject.CreateSchema();
     var xdoc = XDocument.Parse(schema);
     var ns = xdoc.Root.Name.Namespace;
     var depenencies = xdoc.Element(ns + "package").Element(ns + "metadata").Element(ns + "dependencies");
     Assert.That(depenencies, Is.Not.Null);
     Assert.That(depenencies.Nodes().Count(), Is.EqualTo(1));
 }