예제 #1
0
        public async Task ItCanCreateAndRetrieveRepoSettings()
        {
            var repoSettings = new RepoSettings
            {
                OwnerId      = "owner-1",
                RepositoryId = "repo-1",
                OwnerIsOrg   = false,
                LastModified = DateTime.UtcNow
            };

            await _store.CreateOrUpdateRepoSettingsAsync(repoSettings);

            var retrievedRepoSettings = await _store.GetRepoSettingsAsync("owner-1", "repo-1");

            retrievedRepoSettings.Id.Should().Be("owner-1/repo-1");
            retrievedRepoSettings.OwnerId.Should().Be("owner-1");
            retrievedRepoSettings.RepositoryId.Should().Be("repo-1");
            (retrievedRepoSettings.OwnerIsOrg).Should().BeFalse();
            retrievedRepoSettings.LastModified.Should().BeCloseTo(repoSettings.LastModified);

            var retrievedByIdRepoSettings = await _store.GetRepoSettingsByIdAsync("owner-1/repo-1");

            retrievedByIdRepoSettings.Id.Should().Be("owner-1/repo-1");
            retrievedByIdRepoSettings.OwnerId.Should().Be("owner-1");
            retrievedByIdRepoSettings.RepositoryId.Should().Be("repo-1");
            (retrievedByIdRepoSettings.OwnerIsOrg).Should().BeFalse();
            retrievedByIdRepoSettings.LastModified.Should().BeCloseTo(repoSettings.LastModified);
        }
예제 #2
0
        public async void ItCanRetrieveRepoSettingsById()
        {
            var result = await _store.GetRepoSettingsByIdAsync("owner-0/repo-0");

            result.Should().NotBeNull();
            result.OwnerId.Should().Be("owner-0");
            result.RepositoryId.Should().Be("repo-0");
        }