Пример #1
0
            public void OnChanged(object sender, ComposablePartCatalogChangeEventArgs args)
            {
                Assert.True(this._expectedAdds != null || this._expectedRemoves != null);

                if (this._expectedAdds == null)
                {
                    Assert.Empty(args.AddedDefinitions);
                }
                else
                {
                    EqualityExtensions.CheckSequenceEquals(this._expectedAdds, GetDisplayNames(args.AddedDefinitions));
                }

                if (this._expectedRemoves == null)
                {
                    Assert.Empty(args.RemovedDefinitions);
                }
                else
                {
                    EqualityExtensions.CheckSequenceEquals(this._expectedRemoves, GetDisplayNames(args.RemovedDefinitions));
                }

                Assert.Null(args.AtomicComposition);
                Assert.True(ContainsChanges());

                this._changedEventCount++;
            }
Пример #2
0
            public void OnChanging(object sender, ComposablePartCatalogChangeEventArgs args)
            {
                Assert.True(this._expectedAdds != null || this._expectedRemoves != null);

                if (this._expectedAdds == null)
                {
                    Assert.Empty(args.AddedDefinitions);
                }
                else
                {
                    EqualityExtensions.CheckSequenceEquals(this._expectedAdds, GetDisplayNames(args.AddedDefinitions));
                }

                if (this._expectedRemoves == null)
                {
                    Assert.Empty(args.RemovedDefinitions);
                }
                else
                {
                    EqualityExtensions.CheckSequenceEquals(this._expectedRemoves, GetDisplayNames(args.RemovedDefinitions));
                }

                Assert.False(ContainsChanges(), "The catalog should NOT contain the changes yet");

                this._changingEventCount++;
            }
Пример #3
0
        [ActiveIssue(25498, TestPlatforms.AnyUnix)] // System.Reflection.ReflectionTypeLoadException : Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
        public void Constructor_ValueAsCatalogArgument_ShouldSetPartsProperty()
        {
            var expectations = Expectations.GetAssemblies();

            foreach (var e in expectations)
            {
                var catalog = CreateAssemblyCatalog(e);

                var proxy = new AssemblyCatalogDebuggerProxy(catalog);

                EqualityExtensions.CheckSequenceEquals(catalog.Parts, proxy.Parts);
            }
        }