<?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/nmock/feature-requests/" rel="alternate"/><link href="https://sourceforge.net/p/nmock/feature-requests/feed.atom" rel="self"/><id>https://sourceforge.net/p/nmock/feature-requests/</id><updated>2009-06-05T10:55:08Z</updated><subtitle>Recent changes to feature-requests</subtitle><entry><title>Faking Static Methods</title><link href="https://sourceforge.net/p/nmock/feature-requests/24/" rel="alternate"/><published>2009-06-05T10:55:08Z</published><updated>2009-06-05T10:55:08Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.netd0e79cc3c14de25f489807500e4ea7d8320d1272</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Currently, I don't see it's possible to fake static methods which is needed maybe in every project.&lt;/p&gt;
&lt;p&gt;I think the quickest way to implement this is to have a look at the TypeMock assembly code using .NET Reflector, then finding &lt;br /&gt;
out how they are implementing how to fake static methods and finally writing your own customized NMock version.&lt;/p&gt;
&lt;p&gt;I attached the assembly as well (it's free to download and try from their site I believe).&lt;/p&gt;
&lt;p&gt;Pooya&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Can you provide a .net compact version</title><link href="https://sourceforge.net/p/nmock/feature-requests/23/" rel="alternate"/><published>2009-05-25T03:57:11Z</published><updated>2009-05-25T03:57:11Z</updated><author><name>Arno Kan</name><uri>https://sourceforge.net/u/arnokan/</uri></author><id>https://sourceforge.net358e4189cade7d8ccda6f8d5c69413101e9355fc</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;it's every encouraging to see this nice &amp;amp; clean solution, any chance to provide a .net compact version?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Xml Documentation</title><link href="https://sourceforge.net/p/nmock/feature-requests/22/" rel="alternate"/><published>2008-05-07T21:54:35Z</published><updated>2008-05-07T21:54:35Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.netc32d152361574e793b8c3896a8b52fdb8774bd5d</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Plase add Xml documentation to DLLs.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Please add Generics Support</title><link href="https://sourceforge.net/p/nmock/feature-requests/21/" rel="alternate"/><published>2008-05-06T14:24:31Z</published><updated>2008-05-06T14:24:31Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.nete5e4897d3a9cc7d2ed6c6259b117a175dc70e9dd</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;NMock2 fails hard with Interfaces that contain generic methods.&lt;/p&gt;
&lt;p&gt;For example adding "X GenericMethod&amp;lt;X&amp;gt;();" to the IHelloWorld interface in the AcceptanceTests causes those tests to fail.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Add MockEvent support</title><link href="https://sourceforge.net/p/nmock/feature-requests/20/" rel="alternate"/><published>2008-03-19T09:16:16Z</published><updated>2008-03-19T09:16:16Z</updated><author><name>Joannes Vermorel</name><uri>https://sourceforge.net/u/joannes/</uri></author><id>https://sourceforge.netb273560cffed202ed49030bfb0d3ada064f50b43</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Manicprogrammer has a great article about testing delegates and events with NMock.&lt;br /&gt;
&lt;a href="http://manicprogrammer.com/cs/blogs/willeke/archive/2007/10/17/testing-delegates-with-nunit-and-nmock.aspx" rel="nofollow"&gt;http://manicprogrammer.com/cs/blogs/willeke/archive/2007/10/17/testing-delegates-with-nunit-and-nmock.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The amount logic is fairly, I would really need this to be included "by default" in NMock.&lt;/p&gt;
&lt;p&gt;Thanks in advance,&lt;br /&gt;
Joannès&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>It would be better to sign all NMock assemblies with .snk</title><link href="https://sourceforge.net/p/nmock/feature-requests/19/" rel="alternate"/><published>2007-12-14T15:38:40Z</published><updated>2007-12-14T15:38:40Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.net0de3d27908b6b8adef1a714c2df76186101b8f25</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;For example I need this feature for InternalsVisibleTo attribute - it works only for signed assemblies, so I have to sign my test library with it, but I can not reference NMock2.dll then, because it is unsigned&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Supporting classes as well as interfaces</title><link href="https://sourceforge.net/p/nmock/feature-requests/18/" rel="alternate"/><published>2007-10-16T07:37:07Z</published><updated>2007-10-16T07:37:07Z</updated><author><name>Anonymous</name><uri>https://sourceforge.net/u/userid-None/</uri></author><id>https://sourceforge.nete4c920e70383b6329739319a8ee1c4c72f071abf</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;It would be helpful to support classes as well as just interfaces. Occasionally I had to specifically make an interface to use NMock. I believe there is a minor use case for this.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Enum for method/prop names for expectations</title><link href="https://sourceforge.net/p/nmock/feature-requests/17/" rel="alternate"/><published>2007-08-17T05:02:14Z</published><updated>2007-08-17T05:02:14Z</updated><author><name>Kareem Fawell</name><uri>https://sourceforge.net/u/kfawell/</uri></author><id>https://sourceforge.net0f6deb8d8bae869692f81cbad4ee2024d10ec2b3</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Instead of using a string to specify a method or property name in an expecation call, provide an enum with an enumerator list of the names of the methods and properties. That would be safer in that a misspelling won't happen (thought a mis-selection could). It would be more convenient in that Intellisense would list the available methods and properties and allow for auto completion.&lt;/p&gt;
&lt;p&gt;I suppose for overloads, the enum constants could include the arguments in some kind of name mangling, but that seems like overkill.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Provide lazy evaluation of values</title><link href="https://sourceforge.net/p/nmock/feature-requests/16/" rel="alternate"/><published>2007-07-10T03:32:45Z</published><updated>2007-07-10T03:32:45Z</updated><author><name>Daniel Cazzulino (kzu)</name><uri>https://sourceforge.net/u/dcazzulino/</uri></author><id>https://sourceforge.net5a8a9e314a41c314cc31d55d37959b1ccfe970d5</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;When setting expectations on object values, it's quite useful to evaluate the expected values in a lazy way, so that the test code has a chance to set the value.&lt;/p&gt;
&lt;p&gt;i.e. consider the case where I'm setting an expectation on a view interface that will check that an argument passed-in matches a value existing on the correponding presenter, which is what's under test:&lt;/p&gt;
&lt;p&gt;Expect.Once.On(view).&lt;br /&gt;
Method("SetDatabaseFilename").With(DatabaseFilename);&lt;br /&gt;
Expect.Once.On(view).&lt;br /&gt;
Method("SetDatabase").With(new LazyEqualsToMatcher(delegate() { return presenter.Database; }));&lt;/p&gt;
&lt;p&gt;presenter.DatabaseFileChanged(Path.GetFullPath(DatabaseFilename));&lt;/p&gt;
&lt;p&gt;Note that it's the presenter action DatabaseFileChanged the one that actually sets the presenter.Database value that we need in order to verify the expectation on the view. Without a lazy evaluation of that property at the time the method is invoked on the view, we have no way of actually setting the expectation. If we had used:&lt;/p&gt;
&lt;p&gt;Expect.Once.On(view).&lt;br /&gt;
Method("SetDatabase").With(presenter.Database);&lt;/p&gt;
&lt;p&gt;The database would have been null at that point, and the expectation would be wrong.&lt;/p&gt;
&lt;p&gt;The LazyEqualsToMatcher is pretty simple:&lt;/p&gt;
&lt;p&gt;public delegate object LazyValueHandler();&lt;/p&gt;
&lt;p&gt;public class LazyEqualsToMatcher : Matcher&lt;br /&gt;
{&lt;br /&gt;
LazyValueHandler valueHandler;&lt;/p&gt;
&lt;p&gt;public LazyEqualsToMatcher(LazyValueHandler valueHandler)&lt;br /&gt;
{&lt;br /&gt;
this.valueHandler = valueHandler;&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;public override void DescribeTo(TextWriter writer)&lt;br /&gt;
{&lt;br /&gt;
Is.EqualTo(valueHandler()).DescribeTo(writer);&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;public override bool Matches(object o)&lt;br /&gt;
{&lt;br /&gt;
return Is.EqualTo(valueHandler()).Matches(o);&lt;br /&gt;
}&lt;br /&gt;
}&lt;/p&gt;
&lt;p&gt;It just wraps the Is.EqualsTo matcher but evaluates the property at matching time instead of construction time.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Create DelegateMatcher</title><link href="https://sourceforge.net/p/nmock/feature-requests/15/" rel="alternate"/><published>2007-07-10T02:58:11Z</published><updated>2007-07-10T02:58:11Z</updated><author><name>Daniel Cazzulino (kzu)</name><uri>https://sourceforge.net/u/dcazzulino/</uri></author><id>https://sourceforge.net417a238580be7b325345eef56e8752d91a204466</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Create a matcher that receives a delegate that performs the matching. This would avoid creation of custom matchers for many common scenarios (i.e. lazy check on property values, etc.).&lt;/p&gt;
&lt;p&gt;Expect.Once.On(foo).With(new DelegateMatcher(delegate { return bar.Value == "hello"; }));&lt;/p&gt;
&lt;p&gt;Note that with C# 3.0 syntax it will look much better:&lt;/p&gt;
&lt;p&gt;Expect.Once.On(foo).With(new DelegateMatcher(() =&amp;gt; bar.Value == "hello"));&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>