コード例 #1
0
        public void TestAddApp()
        {
            var capabilityList = CapabilityListTest.CreateTestCapabilityList();
            var target         = new FeedTarget(FeedTest.Test1Uri, new Feed {
                Name = "Test", CapabilityLists = { capabilityList }
            });

            _integrationManager.AddApp(target);

            var expectedAppEntry = new AppEntry {
                InterfaceUri = FeedTest.Test1Uri, Name = target.Feed.Name, CapabilityLists = { capabilityList }
            };

            CollectionAssert.AreEqual(new[] { expectedAppEntry }, _integrationManager.AppList.Entries);

            Assert.Throws <InvalidOperationException>(() => _integrationManager.AddApp(target), "Do not allow adding applications to AppList more than once.");
        }
コード例 #2
0
        public void TestAddApp()
        {
            var capabilityList = CapabilityListTest.CreateTestCapabilityList();
            var target         = new FeedTarget(FeedTest.Test1Uri, new Feed {
                Name = "Test", CapabilityLists = { capabilityList }
            });

            _integrationManager.AddApp(target);

            _integrationManager.AppList.Entries
            .Should().Equal(new AppEntry {
                InterfaceUri = FeedTest.Test1Uri, Name = target.Feed.Name, CapabilityLists = { capabilityList }
            });

            _integrationManager.Invoking(x => x.AddApp(target))
            .Should().Throw <InvalidOperationException>(because: "Do not allow adding applications to AppList more than once.");
        }