Ejemplo n.º 1
0
    public void UpdateApp()
    {
        var capabilityList = new CapabilityList
        {
            OS      = Architecture.CurrentSystem.OS,
            Entries = { new Model.Capabilities.FileType {
                            ID = "my_ext1"
                        }, new Model.Capabilities.FileType{
                            ID = "my_ext2"
                        } }
        };
        var feed = new Feed {
            Name = "Test 1", CapabilityLists = { capabilityList }
        };
        var accessPoints = new AccessPoint[] { new MockAccessPoint {
                                                   ID = "id1", Capability = "my_ext1"
                                               } };

        var appEntry = _integrationManager.AddApp(new FeedTarget(FeedTest.Test1Uri, feed));

        _integrationManager.AddAccessPoints(appEntry, feed, accessPoints);
        _integrationManager.AppList.Entries[0].AccessPoints !.Entries
        .Should().Equal(accessPoints, because: "All access points should be applied.");

        // Modify feed
        feed.Name = "Test 2";
        capabilityList.Entries.RemoveLast();

        _integrationManager.UpdateApp(appEntry, feed);
        appEntry.Name.Should().Be("Test 2");
        _integrationManager.AppList.Entries[0].AccessPoints !.Entries
        .Should().Equal(new[] { accessPoints[0] }, because: "Only the first access point should be left.");
    }