If I have a MockingContainer and use Get<T> on it, and then try to Mock.Raise on an event of T, I receive an error: Unable to specify which event was deduced in the parameter. If I replace that with the same type generated by Mock.Create<T>, it works.
1 Answer, 1 is accepted
0
Kaloyan
Telerik team
answered on 22 Nov 2013, 01:24 PM
Hello Isaac,
I tried the following test:
public interface IAccount
{
event EventHandler<EventArgs> DepositMade;
}
public class BankTransation
{
readonly IAccount _fromAccount;
public BankTransation(IAccount acc)
{
this._fromAccount = acc;
}
}
[TestMethod]
public void ShouldArrangeRaisesBehavior()
{
var container = new MockingContainer<BankTransation>();
Mock.Raise(() => container.Get<IAccount>().DepositMade += null, new EventArgs());
Assert.IsTrue(eventRaised);
}
and it passed.
Could you please provide a code sample of the issue?
Thank you for the understanding in advance.
Regards,
Kaloyan
Telerik
Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums, or our JustTrace or JustMock portals.