public void ToString_IdAndVersionSpecified_ContainsIdAndVersion ()
		{
			var recentPackageInfo = new RecentPackageInfo ("id", new SemanticVersion ("1.0"));

			string actual = recentPackageInfo.ToString ();

			string expected = "[RecentPackageInfo Id=id, Version=1.0]";
			Assert.AreEqual (expected, actual);
		}
        List <RecentPackageInfo> GetRecentPackagesInfo()
        {
            List <RecentPackageInfo> allRecentPackages = new List <RecentPackageInfo>();

            foreach (IPackage package in packages)
            {
                var recentPackageInfo = new RecentPackageInfo(package);
                allRecentPackages.Add(recentPackageInfo);
            }
            return(allRecentPackages);
        }
		public void IsMatch_PackageWithDifferentIdButSameVersionPassed_ReturnsFalse ()
		{
			var version = new SemanticVersion (1, 0, 0, 0);
			var recentPackageInfo = new RecentPackageInfo ("id", version);
			var package = new FakePackage ("different-id");
			package.Version = version;

			bool result = recentPackageInfo.IsMatch (package);

			Assert.IsFalse (result);
		}
		public void IsMatch_PackageWithSameIdButDifferentVersionPassed_ReturnsFalse ()
		{
			string id = "id";
			var version = new SemanticVersion (1, 0, 0, 0);
			var recentPackageInfo = new RecentPackageInfo (id, version);
			var package = new FakePackage (id);
			package.Version = new SemanticVersion (2, 0, 0, 0);

			bool result = recentPackageInfo.IsMatch (package);

			Assert.IsFalse (result);
		}
		List<RecentPackageInfo> GetRecentPackagesInfo()
		{
			List<RecentPackageInfo> allRecentPackages = new List<RecentPackageInfo>();
			foreach (IPackage package in packages) {
				var recentPackageInfo = new RecentPackageInfo(package);
				allRecentPackages.Add(recentPackageInfo);
			}
			return allRecentPackages;
		}
		public void RecentPackages_OneRecentPackageAddedAndOptionsReloadedFromSavedProperties_ContainsOneRecentPackageThatWasSavedPreviously ()
		{
			CreateOptions ();
			var package = new FakePackage ("Test");
			var recentPackage = new RecentPackageInfo (package);
			options.RecentPackages.Add (recentPackage);
			CreateOptions (properties);

			IList<RecentPackageInfo> recentPackages = options.RecentPackages;

			var expectedRecentPackages = new RecentPackageInfo[] {
				new RecentPackageInfo (package)
			};

			RecentPackageInfoCollectionAssert.AreEqual (expectedRecentPackages, recentPackages);
		}
		RecentPackageInfo AddRecentPackageToOptions (string id, string version)
		{
			var recentPackage = new RecentPackageInfo (id, new SemanticVersion (version));
			options.RecentPackages.Add (recentPackage);
			return recentPackage;
		}
		RecentPackageInfo AddOneRecentPackage ()
		{
			var recentPackage = new RecentPackageInfo ("Id", new SemanticVersion ("1.0"));
			packageSourcesHelper.Options.RecentPackages.Add (recentPackage);
			return recentPackage;
		}
		public void RecentPackageRepository_OneRecentPackage_RecentPackageUsedToCreateRecentPackageRepository ()
		{
			CreateCache ();
			RecentPackageInfo recentPackage = AddOneRecentPackage ();

			IRecentPackageRepository repository = cache.RecentPackageRepository;

			IList<RecentPackageInfo> actualRecentPackages = fakePackageRepositoryFactory.RecentPackagesPassedToCreateRecentPackageRepository;

			var expectedRecentPackages = new RecentPackageInfo[] {
				recentPackage
			};

			Assert.AreEqual (expectedRecentPackages, actualRecentPackages);
		}