Ejemplo n.º 1
0
        public void SanitizeKeyTests(string oldKey, string newKey)
        {
            // Act
            var result = KeyFormatter.SanitizeKey(oldKey);

            // Assert
            result.Should().Be(newKey);
        }
Ejemplo n.º 2
0
        public RepositoryConfiguration(
            string repositoryOwner,
            string repositoryName,
            string hashTags)
        {
            PartitionKey = KeyFormatter.SanitizeKey(Configuration.RepositoryConfigurations.PartitionKey);
            RowKey       = KeyFormatter.SanitizeKey($"{repositoryOwner}|{repositoryName}");

            RepositoryOwner = repositoryOwner;
            RepositoryName  = repositoryName;
            HashTags        = hashTags;
            CreatedAt       = DateTime.UtcNow;
            IsActive        = true;
        }
Ejemplo n.º 3
0
        public PublicationConfiguration(
            string publicationSourceOwner,
            string publicationSourceName,
            string publicationUrl,
            string hashTags)
        {
            PartitionKey = KeyFormatter.SanitizeKey(Configuration.PublicationConfigurations.PartitionKey);
            RowKey       = KeyFormatter.SanitizeKey($"{publicationSourceOwner}|{publicationSourceName}");

            PublicationSourceOwner = publicationSourceOwner;
            PublicationSourceName  = publicationSourceName;
            PublicationSourceUrl   = publicationUrl;
            HashTags = hashTags;
            IsActive = true;
        }
Ejemplo n.º 4
0
 public Publication(
     string publicationSourceName,
     string id,
     DateTimeOffset publicationDate,
     string title,
     string description,
     string url,
     string hashTags)
 {
     PartitionKey          = KeyFormatter.SanitizeKey(publicationSourceName);
     PublicationSourceName = publicationSourceName;
     RowKey          = KeyFormatter.SanitizeKey($"{id}-{publicationDate.ToUnixTimeSeconds()}");
     Id              = id;
     PublicationDate = publicationDate;
     Title           = title;
     Description     = description;
     Url             = url;
     HashTags        = hashTags;
 }
Ejemplo n.º 5
0
        public RepositoryRelease(
            string repositoryName,
            int releaseId,
            string releaseName,
            string tagName,
            DateTimeOffset createdAt,
            string htmlUrl,
            string body,
            string hashTags
            )
        {
            PartitionKey = KeyFormatter.SanitizeKey(repositoryName);
            RowKey       = KeyFormatter.SanitizeKey($"{releaseId.ToString()}-{tagName}");

            ReleaseId        = releaseId;
            RepositoryName   = repositoryName;
            ReleaseName      = releaseName;
            TagName          = tagName;
            ReleaseCreatedAt = createdAt;
            HtmlUrl          = htmlUrl;
            Body             = body;
            HashTags         = hashTags;
            CreatedAt        = DateTimeOffset.Now;
        }