public void Promote_WhenShouldNotBeIncluded_ReturnsCompleteKeyValuePairWithNullValue() { // Arrange var graph = InitializeGraph(ResourceUri, Id, Version); var isDelegateInvoked = new DelegateInvoked(shouldInclude: false); // Act var pair = RegistrationCatalogEntry.Promote( ResourceUri, graph, isDelegateInvoked.Delegate, IsExistingItem); // Assert Assert.Equal(pair.Key.RegistrationKey.Id, Id); Assert.Equal(pair.Key.Version, Version); Assert.Null(pair.Value); Assert.True(isDelegateInvoked.Invoked, "The delegate to determine whether an entry should have been invoked."); }
public void Promote_WithDelete_ReturnsCompleteKeyValuePairWithNullValue() { // Arrange var graph = InitializeGraph(ResourceUri, Id, Version); graph.Assert( graph.CreateUriNode(new Uri(ResourceUri)), graph.CreateUriNode(Schema.Predicates.Type), graph.CreateUriNode(Schema.DataTypes.PackageDelete)); var delegateInvoked = new DelegateInvoked(shouldInclude: true); // Act var pair = RegistrationCatalogEntry.Promote( ResourceUri, graph, delegateInvoked.Delegate, IsExistingItem); // Assert Assert.Equal(pair.Key.RegistrationKey.Id, Id); Assert.Equal(pair.Key.Version, Version); Assert.Null(pair.Value); Assert.False(delegateInvoked.Invoked, "The delegate to determine whether an entry should not have been invoked."); }