1

I am using Visual Studio 2012. I intentionally prepared some XML files with specific errors in order to unit test my XML Schema. I would like to suppress only the warnings I prepared. Examples of the warnings are:

Warning 3   'ProductRef' is already used as an ID.  <some_path>\'ProductRef' should be unique.nbs.xml
Warning 2   The 'ProductRef' element is invalid - The value '' is invalid according to its datatype 'String' - The actual length is less than the MinLength value.  <some_path>\'ProductRef' should not be empty.nbs.xml
Warning 1   The value of the 'version' attribute does not equal its fixed value.    <some_path>\root@'version' should be 1.0.nbs.xml

The following links did not help:

Community
  • 1
  • 1
Andrej Adamenko
  • 1,650
  • 15
  • 31
  • What version of Visual Studio are you using? What is the specific error message that you are receiving? What document is causing the error? You've given us nothing to go on here. – DWRoelands Sep 02 '14 at 19:45
  • @DWRoelands, thank for your hint, I added more details – Andrej Adamenko Sep 02 '14 at 20:07
  • Rather than worrying about suppressing warnings, I prefer to detect expected errors/warnings and report unit test failures when expectations are violated either by the absence of those errors/warnings or by the presence of unexpected errors/warnings. – kjhughes Sep 03 '14 at 01:21
  • @kjhughes, My unit tests expect those failures. They are negative tests and expect XML schema validation to fail under certain conditions. All my tests pass and work as intended. My question was not about unit tests, it was about suppressing warnings. – Andrej Adamenko Sep 03 '14 at 07:20

0 Answers0