Ejemplo n.º 1
0
            public async Task DeletesBlobFromHivesAndReplicaHives()
            {
                ReplicaHives.Add(HiveType.Gzipped);
                ReplicaHives.Add(HiveType.SemVer2);

                await Target.DeleteUrlAsync(Hive, ReplicaHives, "https://example/reg/nuget.versioning/1.0.0.json");

                LegacyContainer.Verify(x => x.GetBlobReference("nuget.versioning/1.0.0.json"), Times.Once);
                GzippedContainer.Verify(x => x.GetBlobReference("nuget.versioning/1.0.0.json"), Times.Once);
                SemVer2Container.Verify(x => x.GetBlobReference("nuget.versioning/1.0.0.json"), Times.Once);
                LegacyBlob.Verify(x => x.DeleteIfExistsAsync(), Times.Once);
                GzippedBlob.Verify(x => x.DeleteIfExistsAsync(), Times.Once);
                SemVer2Blob.Verify(x => x.DeleteIfExistsAsync(), Times.Once);
            }
Ejemplo n.º 2
0
            public async Task WritesToReplicaHives()
            {
                ReplicaHives.Add(HiveType.Gzipped);
                ReplicaHives.Add(HiveType.SemVer2);

                await Target.WriteLeafAsync(Hive, ReplicaHives, Id, Version, Leaf);

                LegacyBlob.Verify(x => x.UploadFromStreamAsync(It.IsAny <Stream>(), It.IsAny <AccessCondition>()), Times.Once);
                GzippedBlob.Verify(x => x.UploadFromStreamAsync(It.IsAny <Stream>(), It.IsAny <AccessCondition>()), Times.Once);
                SemVer2Blob.Verify(x => x.UploadFromStreamAsync(It.IsAny <Stream>(), It.IsAny <AccessCondition>()), Times.Once);
                EntityBuilder.Verify(x => x.UpdateLeafUrls(It.IsAny <RegistrationLeaf>(), It.IsAny <HiveType>(), It.IsAny <HiveType>()), Times.Exactly(3));
                EntityBuilder.Verify(x => x.UpdateLeafUrls(Leaf, HiveType.Legacy, HiveType.Gzipped), Times.Once);
                EntityBuilder.Verify(x => x.UpdateLeafUrls(Leaf, HiveType.Gzipped, HiveType.SemVer2), Times.Once);
                EntityBuilder.Verify(x => x.UpdateLeafUrls(Leaf, HiveType.SemVer2, HiveType.Legacy), Times.Once);
            }