private Resource CreateResource(ColidEntryLifecycleStatus colidEntryLifecycleStatus) { return(new ResourceBuilder() .GenerateSampleData() .WithEntryLifecycleStatus(colidEntryLifecycleStatus) .Build()); }
private Resource CreateResourceWithVersion(ColidEntryLifecycleStatus colidEntryLifecycleStatus, string version) { return(new ResourceBuilder() .GenerateSampleData() .WithEntryLifecycleStatus(colidEntryLifecycleStatus) .WithVersion(version) .Build()); }
private Resource CreateResourceWithVersionAndLaterVersion(ColidEntryLifecycleStatus colidEntryLifecycleStatus, string version) { return(new ResourceBuilder() .GenerateSampleData() .WithEntryLifecycleStatus(colidEntryLifecycleStatus) .WithVersion(version) .WithLaterVersion(GetRandomPidUri().ToString()) .Build()); }
public static bool ContainsEntryLifecycleStatus(this IDictionary <string, List <dynamic> > property, ColidEntryLifecycleStatus entryLifecycleStatus) { return(ContainsSingleValue(property, Graph.Metadata.Constants.Resource.HasEntryLifecycleStatus, entryLifecycleStatus.GetDescription())); }
public void InternalHasValidationResult_OverwritePropertyWithNewDateTime(ResourceCrudAction crudAction, ColidEntryLifecycleStatus currentEntryLifecycleStatus, string expectedEntryLifecycleStatus) { // Arrange var resource = new ResourceBuilder() .GenerateSampleData() .WithEntryLifecycleStatus(currentEntryLifecycleStatus) .Build(); EntityValidationFacade validationFacade = new EntityValidationFacade(crudAction, resource, null, null, _metadata, null); // Act _validator.HasValidationResult(validationFacade, GetEntryLifecycleStatusProperty(resource)); // Assert Assert.Contains(Graph.Metadata.Constants.Resource.HasEntryLifecycleStatus, validationFacade.RequestResource.Properties); var entryLifecycleStatus = GetEntryLifecycleStatusProperty(validationFacade.RequestResource).Value; Assert.Single(entryLifecycleStatus); Assert.All(entryLifecycleStatus, value => { Assert.Equal(expectedEntryLifecycleStatus, value); }); }
public ResourceBuilder WithEntryLifecycleStatus(ColidEntryLifecycleStatus status) { CreateOrOverwriteProperty(Graph.Metadata.Constants.Resource.HasEntryLifecycleStatus, status.GetDescription()); return(this); }