I like to follow the StyleCop formatting rules to make the code nice and clear, but I recently had a problem with one of its warnings:
All directives used must be placed inside the namespace.
My problem is that I use directives, an assembly reference (for mocking file deletion), and a namespace to juggle in one of my test classes:
using System;
using System.IO;
using Microsoft.Moles.Framework;
using Microsoft.VisualStudio.TestTools.UnitTesting;
[assembly: MoledType(typeof(System.IO.File))]
namespace MyNamespace
{
}
The above tests allow you to work fine, but StyleCop complains that using directives are not inside the namespace.
Entering values โโinside the namespace gives an error that is not recognized by "MoledType".
'assembly' . - . .
, , , - , , StyleCop!
- , ? StyleCop ?