Those silly tests

time to read 1 min | 92 words

Just got a rather pointed reminder why you should try to get as many tests as possible. The code is:

public override void Execute()
	Version version = typeof (VersionCommand).Assembly.GetName().Version;
	Writer.WriteLine("VERSION " + version);

And the test is:

public void Will_return_assembly_version_as_memcached_version()
	var stream = new MemoryStream();
	var cmd = new VersionCommand(stream);
	Assert.AreEqual("VERSION " + typeof(VersionCommand).Assembly.GetName().Version 
		+ "\r\n", ReadAll(stream));

Now, tell me why this is not a stupid test & useless test.