Exemplo n.º 1
0
        public async void CanPostDeletePackagePart()
        {
            (await _sut.EnableWriteAccess(_creds)).Should().BeTrue();
            var sampl = SamplePkgPart();
            var fNme  = sampl.PackageFilename;
            var hash  = sampl.PackageHash;

            var list = await _parts.ListByPkgHash(fNme, hash, new CancellationToken());

            list.Should().HaveCount(0);

            var reply = await _sut.PostNode(sampl, new CancellationToken());

            reply.Should().NotBeNull();
            reply.IsSuccessful.Should().BeTrue();
            reply.Nid.Should().BeGreaterThan(1);

            list = await _parts.ListByPkgHash(fNme, hash, new CancellationToken());

            list.Should().HaveCount(1);

            var delRep = await _sut.DeleteNode(reply.Nid, new CancellationToken());

            delRep.IsSuccessful.Should().BeTrue();

            list = await _parts.ListByPkgHash(fNme, hash, new CancellationToken());

            list.Should().HaveCount(0);
        }
Exemplo n.º 2
0
        private async Task StartChecking()
        {
            IsChecking = true;
            CanWrite   = null;
            CanWrite   = await _client.EnableWriteAccess(Config);

            IsChecking = false;
            if (CanWrite == true)
            {
                WriteAccessEnabled?.Raise();
            }
        }
Exemplo n.º 3
0
        public async void CanPOSTIssues()
        {
            var ok = await _client.EnableWriteAccess(_creds);

            ok.Should().BeTrue("Can write");

            var list = await _sut.List(ErrorState.NeedsReview, new CancellationToken());

            var origCount = list.Count;

            var tkt = GetSampleTicket();

            _sut.Post(tkt);

            await Task.Delay(1000 * 5);

            list = await _sut.List(ErrorState.NeedsReview, new CancellationToken());

            list.Should().HaveCount(origCount + 1);
        }
Exemplo n.º 4
0
        private async Task EnableWriteAccess()
        {
            var ok = await _client.EnableWriteAccess(_creds);

            ok.Should().BeTrue();
        }
Exemplo n.º 5
0
        //[Fact(DisplayName = "Blank RevLog: No revision")]
        //public async void NoRevLog_NoRevision()
        //{
        //    await EnableWriteAccess();

        //    var origCount = await CountCurrentRevisions();

        //    await UpdatePackageNode(null);

        //    var newCount = await CountCurrentRevisions();

        //    newCount.Should().Be(origCount,
        //        "Should not create a revision if revisionLog is blank");
        //}


        private async Task EnableWriteAccess()
        {
            var ok = await _client.EnableWriteAccess(null, false);

            ok.Should().BeTrue("Can write");
        }
Exemplo n.º 6
0
 private async Task EnableWriteAccess()
 => (await _sut.EnableWriteAccess(_creds)).Should().BeTrue();