Exemplo n.º 1
0
        public async void Registered()
        {
            var pkg = new R2Package("Test_Package_1.pkg");

            pkg.FileFound = true;
            pkg.Hash      = DateTime.Now.Ticks.ToString();
            var actual = await _sut.IsUploadable(pkg, new CancellationToken());

            actual.Should().BeTrue(_sut.ReasonWhyNot);
        }
Exemplo n.º 2
0
        private async Task CheckUploadability()
        {
            Text1 = Package.Filename;
            Text2 = "verifying package file ...";

            var ok = await _preCheckr.IsUploadable(Package, new CancellationToken());

            if (!ok)
            {
                Text2 = $"File cannot be uploaded.{L.f}{_preCheckr.ReasonWhyNot}";
                return;
            }

            Package.nid = _preCheckr.LastPackage.nid;
            PackageVerified.Raise(Package);
            Text2 = "Ready for upload";
        }