﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>Max Schmeling commented on Those silly tests</title><description>Oh so subtle. It cracks me up to see such a simple and seemingly pointless test catch such a serious flaw.
</description><link>http://ayende.com/3353/those-silly-tests#comment8</link><guid>http://ayende.com/3353/those-silly-tests#comment8</guid><pubDate>Fri, 06 Jun 2008 14:46:30 GMT</pubDate></item><item><title>Ayende Rahien commented on Those silly tests</title><description>Deparcq,
  
DING DING DING DING!
  
That is the error that the test exposes
</description><link>http://ayende.com/3353/those-silly-tests#comment7</link><guid>http://ayende.com/3353/those-silly-tests#comment7</guid><pubDate>Fri, 06 Jun 2008 08:35:10 GMT</pubDate></item><item><title>Deparcq Pieter commented on Those silly tests</title><description>I'm guessing the ReadAll method is returning an empty string in your test method as you didn't flush the stream in the Execute method? 
</description><link>http://ayende.com/3353/those-silly-tests#comment6</link><guid>http://ayende.com/3353/those-silly-tests#comment6</guid><pubDate>Fri, 06 Jun 2008 08:19:44 GMT</pubDate></item><item><title>Peter commented on Those silly tests</title><description>I mean, if you want to verify the version number, you'd better not to use the same way of the implementation to get the version number of the assembly -- 
  
typeof(VersionCommand).Assembly.GetName().Version 
  
testers should try them best to make the test fail.
  
  
Or I misunderstood something?
</description><link>http://ayende.com/3353/those-silly-tests#comment5</link><guid>http://ayende.com/3353/those-silly-tests#comment5</guid><pubDate>Fri, 06 Jun 2008 07:58:49 GMT</pubDate></item><item><title>Peter commented on Those silly tests</title><description>You get the version the same way with "Execute"?
</description><link>http://ayende.com/3353/those-silly-tests#comment4</link><guid>http://ayende.com/3353/those-silly-tests#comment4</guid><pubDate>Fri, 06 Jun 2008 07:46:21 GMT</pubDate></item><item><title>Raymond Roestenburg commented on Those silly tests</title><description>I am assuming that Writer.WriteLine writes to the memory stream.
  
Your test is valid because you want to make sure that what you write to the stream is done so correctly by Writer.WriteLine (and that the writer is actually writing to your stream), which can be tested by reading the stream and checking the content. 
  
  
You might also be checkin that writing to the stream has left the position in the stream on the right place for reading it afterwards. (guessing a bit here because I don't know what the specifications are and how you want to work with the stream, do you keep it open or not , do you seek to the beginning etc)
  
  
Also, I am hoping that you don't have another VersionCommand class in another assembly, and that you are testing here if your using statement is correct in the unit test.
  
  
</description><link>http://ayende.com/3353/those-silly-tests#comment3</link><guid>http://ayende.com/3353/those-silly-tests#comment3</guid><pubDate>Fri, 06 Jun 2008 07:45:22 GMT</pubDate></item><item><title>Ayende Rahien commented on Those silly tests</title><description>Yes, it compiles. + for string == + .ToString(),
  
\r\n are part of the protocol, so we will leave that aside
</description><link>http://ayende.com/3353/those-silly-tests#comment2</link><guid>http://ayende.com/3353/those-silly-tests#comment2</guid><pubDate>Fri, 06 Jun 2008 07:14:28 GMT</pubDate></item><item><title>Avish commented on Those silly tests</title><description>I can spot two potential points:
  
  
1. The Version property returns System.Version, which is not plussable with string (does that even compile?).
  
  
2. "\r\n" should be Environment.NewLine, or the test will fail on non-Windows environments.
  
  
But from the test name, I understand it has to do with caching, so IDK.
</description><link>http://ayende.com/3353/those-silly-tests#comment1</link><guid>http://ayende.com/3353/those-silly-tests#comment1</guid><pubDate>Fri, 06 Jun 2008 07:11:08 GMT</pubDate></item></channel></rss>