Пример #1
0
        public void ShouldSetIsLatestVersionToTrueWhenSubmittedPackageIsTheFirstForItsId()
        {
            const string packageId = "PackageId";

            _mockedPackageRepository.SetupGet(pr => pr.Collection).Returns(new Package[0].AsQueryable());

            bool isLatestVersion = _latestVersionChecker.IsLatestVersion(packageId, "1.2.3.4");

            Assert.IsTrue(isLatestVersion, "IsLatestVersion should have been set to true.");
        }
Пример #2
0
 private void CreateNewPackage(string tempPath, Package package, string externalPackageUri, string fileExtension)
 {
     VerifyPackageDoesNotAlreadyExist(package.Id, package.Version);
     MovePackageFile(externalPackageUri, tempPath, package, fileExtension);
     package.IsLatestVersion = _latestVersionChecker.IsLatestVersion(package.Id, package.Version);
     _latestVersionUpdater.SetLatestVersionFlagsOfOtherVersionablesWithSameId(package);
     _packageRepository.Create(package);
 }