nerdexam
Microsoft

MB-500 · Question #176

Drag and Drop Question You are developing new features for an app. You must perform unit testing for the features by using the Unit Test framework. You need to create unit test code using…

The correct answer is SysTestMethodAttribute; SysTestInactivateTestAttribute. D365 F&O / X++ SysTest Framework - Unit Test Attributes This question is from the Microsoft Dynamics 365 Finance and Operations (X++) Unit Test (SysTest) framework. --- The Four Available Attributes | Attribute | Purpose | |---|---| | SysTestMethodAttribute | Marks a method as…

Develop and test code

Question

Drag and Drop Question You are developing new features for an app. You must perform unit testing for the features by using the Unit Test framework. You need to create unit test code using appropriate test attributes. Which test attribute should you use? To answer, drag the appropriate test attributes to the correct descriptions. Each test attribute may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content. NOTE: Each correct selection is worth one point. Answer:

Exhibit

MB-500 question #176 exhibit

Answer Area

Drag items

SysTestMethodAttributeSysTestInactivateTestAttributeSysTestCheckInTestAttributeSysTestTargetAttribute

Correct arrangement

  • SysTestMethodAttribute
  • SysTestInactivateTestAttribute

Explanation

D365 F&O / X++ SysTest Framework - Unit Test Attributes

This question is from the Microsoft Dynamics 365 Finance and Operations (X++) Unit Test (SysTest) framework.


The Four Available Attributes

AttributePurpose
SysTestMethodAttributeMarks a method as an executable unit test
SysTestInactivateTestAttributeDisables a test so it is skipped during test runs
SysTestCheckInTestAttributeFlags a test to run during check-in/CI validation
SysTestTargetAttributeDocuments which class/method the test is covering

Why the Correct Arrangement is What It Is

Position 1 → SysTestMethodAttribute

This is the foundational test attribute. Without it, the test runner does not recognize the method as a test at all - it's just an ordinary method. It is the X++ equivalent of [TestMethod] in MSTest. Any method intended to run as a unit test must carry this attribute.

Likely description it maps to: "Identifies a method as a unit test method that the test runner should execute."

Position 2 → SysTestInactivateTestAttribute

This attribute disables a test without deleting it. When applied alongside SysTestMethodAttribute, the test runner will skip the method. This is used when a test is known to be broken, flaky, or temporarily irrelevant, and you want to preserve the code without letting it block test runs.

Likely description it maps to: "Prevents a test method from running without removing it from the codebase."


Why the Other Two Were Not Selected

  • SysTestCheckInTestAttribute - Marks tests for check-in validation pipelines. Not a general "create a test method" or "disable a test" attribute, so it doesn't fit the described scenarios.
  • SysTestTargetAttribute - Purely metadata/documentation; it links the test to its target class or method but has no effect on execution behavior.

Common Misconceptions

  1. Confusing SysTestCheckInTestAttribute with SysTestMethodAttribute - Check-in tests still need SysTestMethodAttribute to actually run; SysTestCheckInTestAttribute only categorizes them.
  2. Thinking SysTestInactivateTestAttribute deletes or comments out the test - It doesn't. The code stays; the runner just skips it.
  3. Omitting SysTestMethodAttribute entirely - A method decorated only with SysTestTargetAttribute or SysTestCheckInTestAttribute will not execute as a test.

Topics

#unit testing#SysTestMethod#test attributes#X++ testing

Community Discussion

No community discussion yet for this question.

Full MB-500 Practice