public void CreatePart_From_InvalidPartDefiniton_ShouldThrowArgumentException() { Assert.Throws <ArgumentException>("partDefinition", () => { var partDefinition = new ConcreteCPD(); var instance = new CPDTest(); AttributedModelServices.CreatePart(partDefinition, instance); }); }
[ActiveIssue(25498, TestPlatforms.AnyUnix)] // System.ArgumentException: ComposablePartDefinition of type 'System.ComponentModel.Composition.AttributedModel.ConcreteCPD' cannot be used in this context. Only part definitions produced by the ReflectionModelServices.CreatePartDefinition are supported. public void CreatePart_From_InvalidPartDefiniton_ShouldThrowArgumentException() { Assert.Throws <ArgumentException>("partDefinition", () => { try { var partDefinition = new ConcreteCPD(); var instance = new CPDTest(); var part = AttributedModelServices.CreatePart(partDefinition, instance); } catch (Exception e) { Console.WriteLine(e); throw; } }); }