public void ShouldReturnStringContainingVersionSpec()
        {
            Dependency dependency = new Dependency {VersionSpec = "(1.0,4.5]"};

            string dependencyString = _dependencyStringFactory.CreateDependencyString(dependency);

            StringAssert.Contains(dependency.VersionSpec, dependencyString, "VersionSpec should have been included in the dependency string.");
        }
        public void ShouldReturnStringContainingNameOfDependency()
        {
            Dependency dependency = new Dependency {Name = "MyDependency"};

            string dependencyString = _dependencyStringFactory.CreateDependencyString(dependency);

            StringAssert.Contains(dependency.Name, dependencyString, "Name should have been included in the dependency string.");
        }
 public string CreateDependencyString(Dependency dependency)
 {
     if (dependency == null)
     {
         throw new ArgumentNullException("dependency");
     }
     return string.Format("{0}:{1}", dependency.Name, dependency.VersionSpec);
 }
        public void ShouldReturnNameFollowedByVersionSpecSeparatedByColon()
        {
            Dependency dependency = new Dependency {Name = "PackageId", VersionSpec = "1.0"};
            string expectedDependencyString = string.Format("{0}:{1}", dependency.Name, dependency.VersionSpec);

            string dependencyString = _dependencyStringFactory.CreateDependencyString(dependency);

            StringAssert.AreEqualIgnoringCase(expectedDependencyString, dependencyString, "Dependency string was formatted incorrectly.");
        }