public void ItShouldProceedWhenFromFailedStateWithNoValidationInProgress() { // Arrange IValidatingEntity <SymbolPackage> validatingSymbolPackage = null; SymbolsPackageServiceMock.Setup(sp => sp.FindPackageByIdAndVersionStrict(PackageId, PackageVersion)) .Returns(validatingSymbolPackage); var validationSet = new PackageValidationSet { PackageId = FailedSymbolPackage.Id, PackageNormalizedVersion = FailedSymbolPackage.Version, PackageKey = FailedSymbolPackageValidatingEntity.Key, PackageValidations = new List <PackageValidation> { new PackageValidation { Type = "SomeValidator" }, } }; // Act bool result = Target.CanProceedToMakePackageAvailable(FailedSymbolPackageValidatingEntity, validationSet); Target.SetStatusAsync(FailedSymbolPackageValidatingEntity, validationSet, PackageStatus.Available); // Assert Assert.True(result); SymbolPackageFileServiceMock.Verify(spfs => spfs.DoesValidationSetPackageExistAsync(It.IsAny <PackageValidationSet>()), Times.Once); }
public void ItShouldNotProceedWhenFromFailedStateWithValidationInProgress() { // Arrange SymbolsPackageServiceMock.Setup(sp => sp.FindPackageByIdAndVersionStrict(PackageId, PackageVersion)) .Returns(ValidatingSymbolPackageValidatingEntity); var validationSet = new PackageValidationSet { PackageId = FailedSymbolPackage.Id, PackageNormalizedVersion = FailedSymbolPackage.Version, PackageKey = FailedSymbolPackageValidatingEntity.Key, PackageValidations = new List <PackageValidation> { new PackageValidation { Type = "SomeValidator" }, } }; // Act bool result = Target.CanProceedToMakePackageAvailable(FailedSymbolPackageValidatingEntity, validationSet); Target.SetStatusAsync(FailedSymbolPackageValidatingEntity, validationSet, PackageStatus.Available); // Assert Assert.False(result); SymbolPackageFileServiceMock.Verify(spfs => spfs.DoesValidationSetPackageExistAsync(It.IsAny <PackageValidationSet>()), Times.Never); SymbolPackageFileServiceMock.Verify(spfs => spfs.CopyValidationSetPackageToPackageFileAsync(It.IsAny <PackageValidationSet>(), It.IsAny <IAccessCondition>()), Times.Never); SymbolPackageFileServiceMock.Verify(spfs => spfs.CopyValidationPackageToPackageFileAsync(It.IsAny <PackageValidationSet>()), Times.Never); SymbolPackageFileServiceMock.Verify(spfs => spfs.UpdatePackageBlobMetadataInValidationSetAsync(It.IsAny <PackageValidationSet>()), Times.Never); SymbolPackageFileServiceMock.Verify(spfs => spfs.UpdatePackageBlobMetadataInValidationAsync(It.IsAny <PackageValidationSet>()), Times.Never); SymbolsPackageServiceMock.Verify(sps => sps.UpdateStatusAsync(It.IsAny <SymbolPackage>(), It.IsAny <PackageStatus>(), It.IsAny <bool>()), Times.Never); }