public void IsSuitableVersion()
 {
     var implementation = ImplementationTest.CreateTestImplementation();
     var candidate      = Build(implementation, requirements: new(FeedTest.Test1Uri, Command.NameRun)
     {
         ExtraRestrictions = { { FeedTest.Test1Uri, new VersionRange("..!1.1") } }
     });
示例#2
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 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();
    }
示例#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);
        }
示例#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();
        }
        public void prop_Interface()
        {
            var expected = typeof(IInterface1);

            var obj = new ImplementationTest<object>(expected)
                          {
                              Interface = expected
                          };

            var actual = obj.Interface;

            Assert.Same(expected, actual);
        }
示例#9
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);
    }
示例#10
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();
        }