-
-
Notifications
You must be signed in to change notification settings - Fork 802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Xamarin.iOS and Xamarin.Android #102
Comments
I'm not sure those platforms support Reflection.Emit, required to generate I'm pretty sure it won't be feasible in iOS, may work on Android though. I'd first try to port Castle DynamicProxy, as that would be the major Thanks! /kzu Daniel Cazzulino On Fri, Mar 21, 2014 at 4:57 PM, JamWils [email protected] wrote:
|
Hi kzu, Sorry it took me so long to get back to you. I was pulled off Xamarin for a while and now I am back on it. I will look into the Castle DynamicProxy. I believe that Android support Reflection.Emit, but Xamarin.iOS definitely does not. I'll get back to you on how I do with Castle DynamicProxy. Thanks, |
We had someone at Xamarin hack it to run on iOS but it will only ever work The only way I see this moving forward, is if we move to compile-time Or we can just say that we don't do anymore dynamic codegen and just fail /kzu On Fri, May 16, 2014 at 2:45 PM, JamWils [email protected] wrote:
|
Thanks, I'll start looking around and playing with it and get back to you. |
Hi @JamWils, have you guys made a decision yet? |
@machadogj, unfortunately, I just don't have the time to look into this like I was hoping too. If I ever get the chance I will let you know. It would be great to have moq running on the clients of both iOS and Android. I am spending most of my time on iOS Swift these days. Thanks! |
I've made a lot of progress toward a working Xamarin.Android port of Castle.Core. I've submitted the first pull request, but there will need to be two or three more after that before the work is fully upstreamed. If moq on Xamarin.Android matters to you as well, let @jonorossi know. |
There shouldn't be a need to use Cecil or something else as DynamicProxy on the .NET Framework allows you to persist the dynamic assembly it creates to disk. I recall some people doing this to run NHibernate with proxy support under medium trust deployments many years ago. Take a look at the unit tests (in the base class) and you'll see just about every unit test also does this to run peverify after generating code. This might be a solution for iOS. |
FYI, I have completed my moq4 port to Xamarin.Android. It passes all of the unit tests using my android branch of Castle. Once that android branch is merged into Castle, I will submit a pull request here for the changes to Moq. |
Sounds great! On Wed, Jan 13, 2016 at 1:32 PM jamesathey [email protected] wrote:
|
@jamesathey, @JamWils, I would like to close this issue for two reasons:
|
Here's an alternative that should work on Xamarin.iOS, Xamarin.Android, Xamarin.UWP https://github.com/kentcb/PCLMock |
Also, stay tuned for Moq 5, which also performs compile-time code generation instead of runtime dynamic proxying. |
@stakx Where can I subscribe to Moq 5 updates? :) |
Subscribe to the https://github.com/moq/moq repo where v5 is being developed. You can also join Moq's Gitter chat at https://gitter.im/moq/moq. |
I've tried using Moq for unit testing on these platforms and seem unable to do so. Has anyone checked whether this is feasible or not? I think trying to move this to a PCL would help with this matter. I can look into it myself if that is fine? I'm new to helping out with an open source project. I love using moq for testing and would like to use it on those platforms.
The text was updated successfully, but these errors were encountered: