public void GetPackagesWithUpdatesTest() { string wd = "c:\\root\\update1"; Uri registry = null; NpmFactory factory = new MockNpmFactory(); NpmPackageManager target = new NpmPackageManager(factory, wd, registry); List<NpmPackageDependency> expected = MockTestData.Outdated1Expected(); IEnumerable<INpmPackageDependency> actual; actual = target.GetPackagesWithUpdates(); Assert.IsNotNull(actual); Assert.AreEqual(expected.Count, actual.Count()); int index = 0; foreach (INpmPackageDependency actualItem in actual) { Assert.AreEqual(expected[index], actualItem, "item value differs"); index++; } }
/// <summary> /// Execute GetPackagesWithUpdates /// </summary> /// <param name="npm">NpmPackageManager instance</param> private static void DoDepends(NpmPackageManager npm) { IEnumerable<INpmPackageDependency> pkgs; pkgs = npm.GetPackagesWithUpdates(); foreach (INpmPackageDependency pkg in pkgs) { Console.WriteLine(pkg.Name); } }