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 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"))); }
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"))); }
public void ShouldAddWithVersion() { var subject = new DependencyGroup(); subject.Add("Project1", "[1,3)"); Assert.That(subject.Depenencies.Count, Is.EqualTo(1)); }
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)); }
public NuGetOptionals AddDependencyGroup(DependencyGroup dependencyGroup) { _parent._depenencyGroups.Add(dependencyGroup); return(this); }
public NuGetOptionals AddDependencyGroup(DependencyGroup dependencyGroup) { _parent._depenencyGroups.Add(dependencyGroup); return this; }