I know this is almost a two year question; but looking at the original context of the question, it looks like @Anthony really wants to use MSpec in their test projects.
The two answers from @bitbonk and @mtijn give great reasons why you should never ignore them at the project level. But these two answers were ignored in Anthony's original intent, which he was trying to use MSpec.
You see that MSpec is a BDD base that uses heavy delegate and field definitions to define your specifications. Often you have unallocated fields and delegates. This makes Warnings fly like crazy in VS, especially if you have StyleCop and other automation tools to keep developers in check.
[Subject(typeof(PostService), "when_calling_Save()"] class with_a_valid_Post_object { It should_save_to_repository; It should_update_post_counter; Behaves_like<Normal_Behaviors> a_PostService; }
Want to guess how many warnings just triggered? When in fact, it is perfectly normal to check our code and projects well in advance. You should not be annoyed by the warning butt when the BDD specification of your design: the whole point of MSpec is to specify a common history in a context with the least amount of syntax noise. Warnings, make it extremely noisy after you create a dozen stories with a dozen or so specifications each!
Now I see people trying to justify the warnings, saying: "Hey, there is no test yet, it is just stunned!" The warnings show that we need to implement them. "In fact, MSpec already presents these" muffled "specifications differently in the Output window at startup, marked as" Missed "in the test results, and are also very beautiful in their output reports. HTML: In other words, you don't need Warnings to shout at you that the specs aren't implemented, because runners are already doing this.
Behaves_like<T> already a little strange. But note that there is no implementation for Behaves_like<T> behaviors . This is just an unattached field in which the MSpec runner uses (all field delegates) and runs them.
So, the solution is simple: for MSpec "Specs" test projects dedicated exclusively to Machine.Specifications projects, I often right-click on the project settings and add them to the Supress field:
0169; 0649
Again, this is only for MSpec test projects (or, indeed, any other BDD C # framework, as they use heavy delegates and unassigned fields). You should never do this for any normal project.
Alternatively, if your team leader denies this editing right for your test project, you can simply implement your specifications by adding to the synaxial noise that you tried to avoid primarily with MSpec (blame your team for what you do your life is more difficult with "context switching"!).
[Subject(typeof(PostService), "when_calling_Save()"] class with_a_valid_Post_object { It should_save_to_repository =()=> { }; It should_update_post_counter =()=> { }; Behaves_like<Normal_Behaviors> a_PostService =()=> { }; }
This is much more ugly, and you are actually diverting attention from the general BDD story you are trying to describe. Not to mention that all your specifications will pass now without any changes (you can add even more to make it unsuccessful, with throw new NotImplementedException() - but seriously?). But this is a way to βimplementβ each field if you do not want to ignore them at the project level.