Test Method: Assessment Test Questions

  1. What parts does a test that conforms to the AAA pattern consist of? (Select all correct responses.)
    • Arrange
    • Act
    • Assert
    • Adjust
  2. Which access modifier and return type do you use to declare a test method?
    • public void
    • protected void
    • public int
    • protected int
  3. What data do you need to provide in a test method?
    • Database instance name
    • Database credentials
    • Acumatica ERP instance name
    • Acumatica ERP instance credentials
    • Graph name
  4. Which of the following statements is true about a test method?
    • You cannot debug a test method.
    • You can debug a test method, but not the tested graph along with the test method.
    • You can debug a test method along with the tested graph.
  5. Which attribute should be assigned to a test method when declaring a test method without parameters?
    • [InlineData]
    • [Theory]
    • [Fact]
    • [MemberData]
  6. Suppose that the TestMethod test method is defined as follows.
    [Theory]
    public void TestMethod(int a, string s)

    Which lines can be used to provide values for the test method arguments? (Select all correct responses.)

    • [InlineData(1)]
    • [InlineData("one")]
    • [InlineData(1, "one")]
    • [InlineData(1, "zero")]
    • [InlineData(1, "one", 2, "two")]
    • [InlineData(1, 2, "one", "two")]
  7. Suppose that in your test project, you have added two test classes. The first test class contains two test methods, each of which has the [Fact] attribute assigned. For the second test class, a test method is created that has the [Theory] attribute and three [InlineData] attributes. How many tests does Test Explorer contain?
    • 2
    • 3
    • 5
    • 6
  8. How is dependency injection implemented in a test project based on the Acumatica Unit Test Framework? (Select all correct responses.)
    • The TestBase.RegisterServices method is overridden.
    • The Autofac.ContainerBuilder.RegisterType generic method is called.
    • A reference to Autofac.dll is added in the test project.
    • A mock service is used instead of a real complex object as a dependency.
    • A mock service is passed to the test method as a parameter.