Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
/ NuGet.Jobs Public archive

Commit

Permalink
Monitoring: undo IsDelete change (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
dtivel authored Nov 28, 2018
1 parent 7579721 commit a9b06a4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Catalog/CatalogIndexEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public bool IsDelete
{
get
{
return Types.Any(type => type == "nuget:PackageDelete" || type == "PackageDelete" || type == Schema.DataTypes.PackageDelete.ToString());
return Types.Any(type => type == "nuget:PackageDelete");
}
}

Expand Down
20 changes: 7 additions & 13 deletions tests/CatalogTests/CatalogIndexEntryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,15 +251,12 @@ public void IsDelete_WhenTypeIsNotPackageDelete_ReturnsFalse()
Assert.False(entry.IsDelete);
}

[Theory]
[InlineData(CatalogConstants.NuGetPackageDelete)]
[InlineData(CatalogConstants.PackageDelete)]
[InlineData("http://schema.nuget.org/schema#PackageDelete")]
public void IsDelete_WhenTypeIsPackageDelete_ReturnsTrue(string type)
[Fact]
public void IsDelete_WhenTypeIsPackageDelete_ReturnsTrue()
{
var entry = new CatalogIndexEntry(
_uri,
type,
CatalogConstants.NuGetPackageDelete,
_commitId,
_commitTimeStamp,
_packageIdentity);
Expand Down Expand Up @@ -323,19 +320,16 @@ public void JsonDeserialization_WhenTypeIsPackageDetails_ReturnsCorrectObject()
Assert.Equal(_packageVersion, entry.Version);
}

[Theory]
[InlineData(CatalogConstants.NuGetPackageDelete)]
[InlineData(CatalogConstants.PackageDelete)]
[InlineData("http://schema.nuget.org/schema#PackageDelete")]
public void JsonDeserialization_WhenTypeIsPackageDelete_ReturnsCorrectObject(string type)
[Fact]
public void JsonDeserialization_WhenTypeIsPackageDelete_ReturnsCorrectObject()
{
var jObject = CreateCatalogIndexJObject(type);
var jObject = CreateCatalogIndexJObject(CatalogConstants.NuGetPackageDelete);
var json = jObject.ToString(Formatting.None, _settings.Converters.ToArray());

var entry = JsonConvert.DeserializeObject<CatalogIndexEntry>(json, _settings);

Assert.Equal(_uri.AbsoluteUri, entry.Uri.AbsoluteUri);
Assert.Equal(type, entry.Types.Single());
Assert.Equal(CatalogConstants.NuGetPackageDelete, entry.Types.Single());
Assert.True(entry.IsDelete);
Assert.Equal(_commitId, entry.CommitId);
Assert.Equal(_commitTimeStamp, entry.CommitTimeStamp);
Expand Down

0 comments on commit a9b06a4

Please sign in to comment.