Are you a candidate looking to sharpen your skills? Try our practice tests or view sample interview questions & Get hired by the best. Click Here×

Skills Test on TDD (Test Driven Development)

Topics Covered

  • Unit Tests
  • Fakes
  • UI testing
  • TestSetUp and TearDown
  • Assertion
  • Basics
  • Verification
  • Returning Mocks
  • Method Mocking
  • Interface Mocking
  • Expectations

Useful for hiring

  • Software Test Engineer - Test Driven Development
  • Senior Full Stack Engineer
  • Software Development Engineer
  • Senior C# Developer

Start hiring job-fit candidates using this assessment

GET A DEMO

"We are impressed with Interview Mocha's comprehensive IT skill test batteries and their ability to provide tailor-made assessments quickly. The results we got from Interview Mocha exceeded our expectations, employees found the tests quick, fun, and a benchmark of their knowledge."

Ajay Garg, Siemens,
Associate Manager
Question

Suppose you have a class A and a method B that you want to mock using the Moq framework. Under which of the following conditions can you mock A and B?

Answer
    • Class A must be sealed and method B must be marked virtual.

    • Class A must not be sealed and method B must be marked virtual.

    • Class A must not be sealed and method B must be marked static.

    • Class A must be sealed and method B must be marked static.

Question

You have mocked an interface containing an integer variable, say varIt, and named the mock object as mockInterface. Which of the following statements make mockInterface return "Accepted" string if varIt is an integer between 0 and 10 (both included)?

Answer
    • mockedInterface.Expect(a => a.Get(It.IsAny<int>(varIt => between[0,10]))).Returns("Accepted");

    • mockedInterface.Expect(a => a.Get(It.Any<value>(varIt => from[0,10]))).Returns("Accepted");

    • mockedInterface.Expect(a => a.Get(It.Is<int>(varIt => varIt>0 && varIt<10))).Returns("Accepted");

    • mockedInterface.Expect(a => a.Get(Int.IsAny(varIt =>from[0] to [10]))).Returns("Accepted");

Question

In order to mock the interface shown below, which of the following options must be used?    

public interface eStore
{
     List Select();
     eProduct Get(int id);
 }

Answer
    • Mock Interface option in the Mock tab in Visual Studio.

    • MockInterface productStore = new MockInterface<eStore>();

    • Mock pane in the Tools tab of Visual Studio.

    • var productStore = new Mock<eStore>();

Good News! You can customize this test as per your requirement

  • Choose and add questions from Interview Mocha question libraries

  • Add your own set of questions

  • Customize test settings like duration, number of questions, passing score, web proctoring and much more

  • Mail us at support@interviewmocha.com to create a custom test

Looking for a tailor-made test, to suit your assessment needs?

Get in touch

Global companies using Mocha assessments

  • altran
  • credit suisse
  • sephora
  • nielsen
  • capgemini
  • akamai

How Mocha assessments are brewed

Speed up your IT recruitment with Interview Mocha

  • 500+ IT skill tests
  • 20+ coding languages
  • 50+ domain knowledge tests
  • 100+ digital 2.0 skill tests
  • Customer focus aptitude tests
  • Enterprise ready features & more...
GET A DEMO

Why hiring managers and recruiters across the globe love Interview Mocha

Take your first step to hire job fit candidates

GET A DEMO