Replies: 6 comments
-
same here ;) |
Beta Was this translation helpful? Give feedback.
-
As posted in Excel-DNA/ExcelDna#21, would be great to see an example AddIn that uses these wrappers and possibly even highlights using IoC (as best as it can be using an Implementation AddIn) with ExcelDNA. |
Beta Was this translation helpful? Give feedback.
-
Thanks guys. It's been on my queue for ages now, but haven't had the time yet. Maybe one (or some) of you could give me a hand to accelerate this? i.e. Send PRs with examples of regular add-ins with (broken or commented out) unit tests that show what and how you'd like to test on these sample add-ins, and I can convert them to use ExcelDna.Abstractions? /cc @mndrake, @darul75, @robodude666 @robodude666 I like the part where you say "as best as it can be" because whilst it is possible to get some level of DI with something like ExcelDna.Abstractions, it is not as pretty as one would like. Unfortunately ExcelDna makes it impossible to have proper constructor injection, due to the lifetime of the objects (e.g. |
Beta Was this translation helpful? Give feedback.
-
Did anyone one happen to make any examples, would be really helpful to see some uses. |
Beta Was this translation helpful? Give feedback.
-
Can you please elaborate why you think it's impossible to support constructor injection? Before I've seen your project I've already written my own wrapper and I do all the injection in AutoOpen which seems to work fine. I've also found the requirement to have functions static too onerous so I actually used expression trees to convert the member functions to static ( see here ) on the fly and using a dictionary service which links internal objects to a 'handle' string which represent the object in Excel. Roughly, a static UDF function is exported f(obj_handle, params) where the underlying lambda expression tree will call dictionary service to convert obj_handle string to object and then invoke the required member method on the converted object. |
Beta Was this translation helpful? Give feedback.
-
Hey @zedr0n, as I said above, the issue is to use construction injection with Ribbons. All ribbons are constructed before |
Beta Was this translation helpful? Give feedback.
-
I found this library via NuGet, but have been unable to use this library to mock Excel-DNA. I was hoping that I could use this to unit test methods that used the built in Excel-DNA async methods. Any examples or sample test projects that you could direct me to would be appreciated.
Thanks,
Dave
Beta Was this translation helpful? Give feedback.
All reactions