Exemple #1
0
        public void MethodComposeTest()
        {
            var import = new MethodToImport();
            var host = new AddinHost();
            host.Compose(import);
            Assert.IsNotNull(import.DoInstance);
            import.DoInstance("hello world!");
            Assert.IsNotNull(import.DoStatic);
            import.DoStatic(-1);

            import.EventWithReturnValue += MethodToExport.EventHandler;
            import.EventWithReturnValue += MethodToExport.OtherEventHandler;
            var str = import.OnEventWithReturnValue();
            Assert.AreEqual(MethodToExport.OtherEventHandler(), str);
        }
Exemple #2
0
 public void ComposeTest()
 {
     var host = new AddinHost();
     var importer = new ViewFactory();
     host.Compose(importer);
 }