示例#1
0
        /// <summary>
        /// Asserts that both DiscoveredInfo are equivalent.
        /// </summary>
        /// <param name="a">A</param>
        /// <param name="b">B</param>
        public static void AssertDiscoveredInfoEquivalence(IDiscoveredInfo a, IDiscoveredInfo b)
        {
            Assert.That(a.PluginInfos.Count == b.PluginInfos.Count);
            Assert.That(a.ServiceInfos.Count == b.ServiceInfos.Count);

            foreach (var sA in a.ServiceInfos)
            {
                var sB = b.ServiceInfos.First(s => sA.ServiceFullName == s.ServiceFullName);

                AssertServiceEquivalence(sA, sB, true);
            }

            foreach (var pA in a.PluginInfos)
            {
                var pB = b.PluginInfos.First(p => pA.PluginFullName == p.PluginFullName);

                AssertPluginEquivalence(pA, pB, true);
            }

            Assert.That(a.IsValid() == b.IsValid());
        }
        /// <summary>
        /// Asserts that both DiscoveredInfo are equivalent.
        /// </summary>
        /// <param name="a">A</param>
        /// <param name="b">B</param>
        public static void AssertDiscoveredInfoEquivalence( IDiscoveredInfo a, IDiscoveredInfo b )
        {
            Assert.That( a.PluginInfos.Count == b.PluginInfos.Count );
            Assert.That( a.ServiceInfos.Count == b.ServiceInfos.Count );

            foreach( var sA in a.ServiceInfos )
            {
                var sB = b.ServiceInfos.First( s => sA.ServiceFullName == s.ServiceFullName );

                AssertServiceEquivalence( sA, sB, true );
            }

            foreach( var pA in a.PluginInfos )
            {
                var pB = b.PluginInfos.First( p => pA.PluginFullName == p.PluginFullName );

                AssertPluginEquivalence( pA, pB, true );
            }

            Assert.That( a.IsValid() == b.IsValid() );
        }