Exemplo n.º 1
0
        public void TestIsSuitable()
        {
            var implementation = ImplementationTest.CreateTestImplementation();

            Assert.IsTrue(new SelectionCandidate(FeedTest.Test1Uri, new FeedPreferences(),
                                                 implementation, new Requirements(FeedTest.Test1Uri, Command.NameRun)).IsSuitable);
        }
 public void IsSuitableVersion()
 {
     var implementation = ImplementationTest.CreateTestImplementation();
     var candidate      = Build(implementation, requirements: new(FeedTest.Test1Uri, Command.NameRun)
     {
         ExtraRestrictions = { { FeedTest.Test1Uri, new VersionRange("..!1.1") } }
     });
    public void IsNotSuitableArchitecture()
    {
        var implementation = ImplementationTest.CreateTestImplementation();
        var candidate      = Build(implementation, requirements: new(FeedTest.Test1Uri, Command.NameRun, new Architecture(OS.FreeBsd, Cpu.Ppc)));

        candidate.IsSuitable.Should().BeFalse();
    }
    public void IsSuitableArchitecture()
    {
        var implementation = ImplementationTest.CreateTestImplementation();
        var candidate      = Build(implementation, requirements: new(FeedTest.Test1Uri, Command.NameRun, implementation.Architecture));

        candidate.IsSuitable.Should().BeTrue();
    }
    public void IsSuitable()
    {
        var implementation = ImplementationTest.CreateTestImplementation();
        var candidate      = Build(implementation);

        candidate.IsSuitable.Should().BeTrue();
    }
Exemplo n.º 6
0
        public void TestIsSuitableArchitecture()
        {
            var implementation = ImplementationTest.CreateTestImplementation();

            Assert.IsTrue(new SelectionCandidate(FeedTest.Test1Uri, new FeedPreferences(),
                                                 implementation, new Requirements(FeedTest.Test1Uri, Command.NameRun, implementation.Architecture)).IsSuitable);
            Assert.IsFalse(new SelectionCandidate(FeedTest.Test1Uri, new FeedPreferences(),
                                                  implementation, new Requirements(FeedTest.Test1Uri, Command.NameRun, new Architecture(OS.FreeBsd, Cpu.Ppc))).IsSuitable);
        }
Exemplo n.º 7
0
        public void TestIsSuitableVersionMismatch()
        {
            var implementation = ImplementationTest.CreateTestImplementation();

            new SelectionCandidate(FeedTest.Test1Uri, new FeedPreferences(), implementation, new Requirements(FeedTest.Test1Uri, Command.NameRun)
            {
                ExtraRestrictions = { { FeedTest.Test1Uri, new VersionRange("..!1.1") } }
            }).IsSuitable.Should().BeTrue();
            new SelectionCandidate(FeedTest.Test1Uri, new FeedPreferences(), implementation, new Requirements(FeedTest.Test1Uri, Command.NameRun)
            {
                ExtraRestrictions = { { FeedTest.Test1Uri, new VersionRange("..!1.0") } }
            }).IsSuitable.Should().BeFalse();
        }
Exemplo n.º 8
0
    public async Task Fetch()
    {
        _launcherMock.Setup(x => x.RunAndCapture(It.IsAny <Action <StreamWriter> >(), "fetch"))
        .Callback((Action <StreamWriter> callback, string[] _) =>
        {
            var stream = new MemoryStream();
            var writer = new StreamWriter(stream);
            callback(writer);
            writer.Flush();
            stream.ReadToString().Should().StartWith("<?xml version=\"1.0\"?><interface");
        })
        .Returns(""); {}

        var implementation = ImplementationTest.CreateTestImplementation();
        await _client.FetchAsync(implementation);
    }
Exemplo n.º 9
0
        public void TestIsSuitableBuggyInsecure()
        {
            var implementation = ImplementationTest.CreateTestImplementation();

            new SelectionCandidate(FeedTest.Test1Uri, new FeedPreferences {
                Implementations = { new ImplementationPreferences {
                                        ID = implementation.ID, UserStability = Stability.Buggy
                                    } }
            }, implementation, new Requirements(FeedTest.Test1Uri, Command.NameRun))
            .IsSuitable.Should().BeFalse();
            new SelectionCandidate(FeedTest.Test1Uri, new FeedPreferences {
                Implementations = { new ImplementationPreferences {
                                        ID = implementation.ID, UserStability = Stability.Insecure
                                    } }
            }, implementation, new Requirements(FeedTest.Test1Uri, Command.NameRun))
            .IsSuitable.Should().BeFalse();
        }