<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to feature-requests</title><link href="https://sourceforge.net/p/dotnetmock/feature-requests/" rel="alternate"/><link href="https://sourceforge.net/p/dotnetmock/feature-requests/feed.atom" rel="self"/><id>https://sourceforge.net/p/dotnetmock/feature-requests/</id><updated>2006-06-14T22:12:38Z</updated><subtitle>Recent changes to feature-requests</subtitle><entry><title>Data Objects</title><link href="https://sourceforge.net/p/dotnetmock/feature-requests/27/" rel="alternate"/><published>2006-06-14T22:12:38Z</published><updated>2006-06-14T22:12:38Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net3c544090a8dabdd8198576aebc79711ddd7a0fd6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;My problem is, that i can only specify one Expected &lt;br /&gt;
DBCommand with a DBConnection&lt;br /&gt;
it would be necessary to set a list of DBCommands &lt;br /&gt;
that are returned in one after another for each &lt;br /&gt;
CreateCommand function call&lt;br /&gt;
(for example the function to test has "select max&lt;br /&gt;
(id)" sql and then "insert()" sql and i want to &lt;br /&gt;
simulate first command passes and second command &lt;br /&gt;
fails)&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Attributes, particularly serializable...</title><link href="https://sourceforge.net/p/dotnetmock/feature-requests/26/" rel="alternate"/><published>2006-03-17T17:23:38Z</published><updated>2006-03-17T17:23:38Z</updated><author><name>nashg842</name><uri>https://sourceforge.net/u/nashg842/</uri></author><id>https://sourceforge.net1bcce018ffde1c21ab2fb613c3a95d571ab236c4</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;If the base class I give to DynamicMock is&lt;br /&gt;
serializable, so should the resulting mock object.  Or&lt;br /&gt;
at least make the option available in the constructor.&lt;/p&gt;
&lt;p&gt;Also any attributes that the base class or interface is&lt;br /&gt;
decorated with should also be decorated on the mock object.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>RaiseEvent feature</title><link href="https://sourceforge.net/p/dotnetmock/feature-requests/25/" rel="alternate"/><published>2005-11-24T03:27:02Z</published><updated>2005-11-24T03:27:02Z</updated><author><name>rgavrilov</name><uri>https://sourceforge.net/u/clavrg/</uri></author><id>https://sourceforge.netc5bb1fa51c090b101fb43507680a8504a56eeb44</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Suppose you have an object called EventSource that has &lt;br /&gt;
a public event. Now you want to test that consumer of &lt;br /&gt;
the EventSource object - EventConsumer handles event &lt;br /&gt;
properly. Tricky part is to make EventSource to throw &lt;br /&gt;
an event during the test.&lt;br /&gt;
I have extended DynamicMock with RaiseEvent method:&lt;/p&gt;
&lt;p&gt;public void RaiseEvent(string eventName, params object&lt;br /&gt;
[] args);&lt;/p&gt;
&lt;p&gt;Upon call the method will call all the delegates that &lt;br /&gt;
were registered with the event. Under the hood dynamic &lt;br /&gt;
mock intercept calls to add_&amp;lt;event&amp;gt; and remove_&amp;lt;event&amp;gt; &lt;br /&gt;
methods and maintains the collection of event handlers &lt;br /&gt;
in a fashion similar to MulticastDelegate.&lt;/p&gt;
&lt;p&gt;As usual limitation is that event has to be declared &lt;br /&gt;
public virtual.&lt;/p&gt;
&lt;p&gt;It also works with interfaces.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Features</title><link href="https://sourceforge.net/p/dotnetmock/feature-requests/24/" rel="alternate"/><published>2005-11-21T18:02:33Z</published><updated>2005-11-21T18:02:33Z</updated><author><name>rgavrilov</name><uri>https://sourceforge.net/u/clavrg/</uri></author><id>https://sourceforge.net9ead17464b043c81b03e068fe418dde22e4abbdb</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;1. Dynamic event handling - provides a framework for &lt;br /&gt;
simple Expect...-driven events handling (creates a &lt;br /&gt;
listener for all events defined on given object and &lt;br /&gt;
allows to verify that expected events were indeed &lt;br /&gt;
raised).&lt;/p&gt;
&lt;p&gt;2. Support for overloaded functions - allows to select &lt;br /&gt;
function to expect in case function is overloaded.&lt;/p&gt;
&lt;p&gt;3. Implicit properties support that allows something &lt;br /&gt;
like:&lt;br /&gt;
// expect get_Name&lt;br /&gt;
mock.ExpectAndReturn("Name", "Roman");&lt;br /&gt;
// expect set_Name&lt;br /&gt;
mock.Expect("Name", "Jeffry");&lt;/p&gt;
&lt;p&gt;4. Default returns:&lt;br /&gt;
// return 55 for 0 or more calls to GetAge.&lt;br /&gt;
mock.ExpectAndReturnDefault("GetAge", 55);&lt;br /&gt;
NOTE: Expectation is still satisfied if no call to &lt;br /&gt;
GetAge made at all.&lt;/p&gt;
&lt;p&gt;5. ExpectNoCall is initially satisfied (Verify does &lt;br /&gt;
not throw an exception if no call were made).&lt;/p&gt;
&lt;p&gt;I have all the features implemented for my needs &lt;br /&gt;
(everything is TDDed). I would like changes to be &lt;br /&gt;
integrated in the trunk.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>params array argument mapping</title><link href="https://sourceforge.net/p/dotnetmock/feature-requests/23/" rel="alternate"/><published>2005-05-02T17:18:22Z</published><updated>2005-05-02T17:18:22Z</updated><author><name>Choy Rim</name><uri>https://sourceforge.net/u/choyrim/</uri></author><id>https://sourceforge.net2257b4a6d3e5cc3b93214c617c7466918c344b33</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Given the sample method signature in the interface IBlah&lt;/p&gt;
&lt;p&gt;void Varargs(params object[] args);&lt;/p&gt;
&lt;p&gt;One would expect the following expectation&lt;/p&gt;
&lt;p&gt;dynamicMock.Expect(new IsTypeOf(typeof(string)), 123);&lt;/p&gt;
&lt;p&gt;to be verified if we executed the following&lt;/p&gt;
&lt;p&gt;IBlah mo = (IBlah) dynamicMock.Object;&lt;br /&gt;
mo.Varargs("123", 123);&lt;br /&gt;
dynamicMock.Verify();&lt;/p&gt;
&lt;p&gt;But instead, the Verify() call fails complaining that&lt;br /&gt;
DotNetMock expects 1 argument of type Object[]  but&lt;br /&gt;
received 2 instead.&lt;/p&gt;
&lt;p&gt;This error makes sense if we look at the IL, etc. But&lt;br /&gt;
from a usage standpoint is surprising. It would be&lt;br /&gt;
better if we detected the final params array and mapped&lt;br /&gt;
the final predicates to each element of the params&lt;br /&gt;
array elements, so that the above code would work.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Argument names don't show up in assertion failure messages</title><link href="https://sourceforge.net/p/dotnetmock/feature-requests/22/" rel="alternate"/><published>2005-04-08T03:13:52Z</published><updated>2005-04-08T03:13:52Z</updated><author><name>Choy Rim</name><uri>https://sourceforge.net/u/choyrim/</uri></author><id>https://sourceforge.neta17e8e8b5d51973b34f2f056a10f0d183b20c4a0</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;The assertion failure messages are a lot more verbose&lt;br /&gt;
now. But the argument names from proxied class are not&lt;br /&gt;
showing up in the proxy class.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Support for overloaded functions.</title><link href="https://sourceforge.net/p/dotnetmock/feature-requests/21/" rel="alternate"/><published>2005-03-18T01:07:04Z</published><updated>2005-03-18T01:07:04Z</updated><author><name>rgavrilov</name><uri>https://sourceforge.net/u/clavrg/</uri></author><id>https://sourceforge.net86412bbed436f4d535fdbd5f227a869120371a93</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Support for overloaded functions.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Predicate failure reason explanation message.</title><link href="https://sourceforge.net/p/dotnetmock/feature-requests/20/" rel="alternate"/><published>2005-03-17T21:11:35Z</published><updated>2005-03-17T21:11:35Z</updated><author><name>rgavrilov</name><uri>https://sourceforge.net/u/clavrg/</uri></author><id>https://sourceforge.net36253c78cab73fec454146ba56c39e3483e00b57</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Some predicates can get quite complex, e.g. I have &lt;br /&gt;
predicate IsEqualImage that compares given image with &lt;br /&gt;
actual image, there are 4 different reasons for image &lt;br /&gt;
failure, would be nice to know why exactly it have failed, &lt;br /&gt;
e.g. different size, different format, different pixel, etc.&lt;/p&gt;
&lt;p&gt;The solution?&lt;br /&gt;
1) Make IPredicate.Eval to throw an execation with &lt;br /&gt;
explanations.&lt;br /&gt;
2) Add "string FailureReason { get; }" to IPredicate.&lt;/p&gt;
&lt;p&gt;Since Verify throws an exception anyway, I think 1st &lt;br /&gt;
solution would be more appropriate.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;
Roman V. Gavrilov&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>System.Windows.Forms.Control can not be mocked.</title><link href="https://sourceforge.net/p/dotnetmock/feature-requests/19/" rel="alternate"/><published>2005-03-16T20:33:44Z</published><updated>2005-03-16T20:33:44Z</updated><author><name>rgavrilov</name><uri>https://sourceforge.net/u/clavrg/</uri></author><id>https://sourceforge.netfe0583e615b5a0f6c98bc92ffdf04d7c2ba2b3cd</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;System.Windows.Forms.Control can not be mocked &lt;br /&gt;
now. Would be nice if it could be mocked.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Parent default constructor requirement</title><link href="https://sourceforge.net/p/dotnetmock/feature-requests/18/" rel="alternate"/><published>2005-03-01T20:23:14Z</published><updated>2005-03-01T20:23:14Z</updated><author><name>rgavrilov</name><uri>https://sourceforge.net/u/clavrg/</uri></author><id>https://sourceforge.net8eb0af3424a30918fbbef2374b0db917f74e2bf9</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Following code will generate run-time error (Parent does &lt;br /&gt;
not have default constructor).&lt;/p&gt;
&lt;p&gt;using System;&lt;br /&gt;
using DotNetMock.Dynamic;&lt;/p&gt;
&lt;p&gt;namespace delitDMWithoutDefConstructor {&lt;/p&gt;
&lt;p&gt;public class Base {&lt;br /&gt;
public Base(string msg) {}&lt;br /&gt;
public Base() {}&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;public class Derived : Base {&lt;br /&gt;
public Derived(string msg) : base(msg) {}&lt;br /&gt;
// Uncomment to resolve the error.&lt;br /&gt;
// public Derived() {}&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;public class Class1 {&lt;br /&gt;
[STAThread]&lt;br /&gt;
static void Main(string[] args) {&lt;br /&gt;
new DynamicMockEx(typeof(Derived));&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;Solutions?&lt;br /&gt;
1. Add constructor with signature matching to one of the &lt;br /&gt;
patern class (mocked class), and call it with some &lt;br /&gt;
default values.&lt;br /&gt;
2. Instead of generating new class that derives from the &lt;br /&gt;
given class, copy the class and replace method code.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>