What is mock?

Moq (514-06)

Quiz
•
Computers
•
1st Grade
•
Hard
Nataly Revutska
Used 1+ times
FREE Resource
9 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
This is a fake object in the system that decides whether or not a unit test has passed or failed.
This is a controllable replacement for an existing dependency (or collaborator) in the system. By using this, you can test your code without dealing with the dependency directly.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Does Moq framework support out/ref arguments?
yes
no
3.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Choose all methods of Mock class
As
Behavior
Get
Verify
OnGetObject
4.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Choose structure of Moq namespace
MockFactory
SequenceExtensions
Times
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Can Mock's Setup method be used with all return types of a function?
Yes
No
6.
MULTIPLE SELECT QUESTION
1 min • 1 pt
Which ways to set up async methods are valid?
mock.Setup(foo => foo.DoSomethingAsync().Result).Returns(true);
mock.Setup(foo => foo.DoSomethingAsync()).ReturnsAsync(true);
mock.Setup(foo => foo.DoSomethingAsync()).Returns(async () => true);
mock.Setup(foo => foo.DoSomethingAsync()).Returns(true);
7.
MULTIPLE SELECT QUESTION
1 min • 1 pt
Which options to match the generic type argument is valid?
(method: bool method<T>();)
mock.Setup(m => m.method<object>()).Returns(true);
mock.Setup(m => m.method()).Returns(true);
mock.Setup(m => m.method<It.IsAnyType>()).Returns(true);
mock.Setup<object>(m => m.method()).Returns(true);
8.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
From current list
What can you Mock?
Statick class
Extension methods
Non-virtual methods
All from the above
Neither from the above
9.
MULTIPLE SELECT QUESTION
1 min • 1 pt
What is It.Is<T> and It.IsAny<T>
It.IsAny<T> is checking that the parameter is of type T, it can be any instance of type T. It's basically saying, I don't care what you pass in here as long as it is type of T.
It.IsAny<T> allows you to inspect what was passed in and determine if the parameter that was passed in meets your needs.
It.Is<T> allows you to inspect what was passed in and determine if the parameter that was passed in meets your needs.
It.Is<T> is checking that the parameter is of type T, it can be any instance of type T. It's basically saying, I don't care what you pass in here as long as it is type of T.
Similar Resources on Quizizz
11 questions
Excle

Quiz
•
1st Grade
14 questions
HTML Tags

Quiz
•
1st Grade
10 questions
Ôn tập cuối năm lần I

Quiz
•
1st - 5th Grade
11 questions
JAVA QUIZ

Quiz
•
1st - 12th Grade
10 questions
Latihan Soal Ms Word

Quiz
•
1st - 12th Grade
11 questions
Kotlin

Quiz
•
1st - 12th Grade
10 questions
SQL Quiz 2

Quiz
•
KG - 1st Grade
10 questions
Aibles javascript quiz

Quiz
•
1st Grade
Popular Resources on Quizizz
10 questions
Chains by Laurie Halse Anderson Chapters 1-3 Quiz

Quiz
•
6th Grade
20 questions
math review

Quiz
•
4th Grade
15 questions
Character Analysis

Quiz
•
4th Grade
12 questions
Multiplying Fractions

Quiz
•
6th Grade
30 questions
Biology Regents Review #1

Quiz
•
9th Grade
20 questions
Reading Comprehension

Quiz
•
5th Grade
20 questions
Types of Credit

Quiz
•
9th - 12th Grade
50 questions
Biology Regents Review: Structure & Function

Quiz
•
9th - 12th Grade
Discover more resources for Computers
10 questions
Identifying equations

Quiz
•
KG - University
20 questions
r- controlled vowels review!

Quiz
•
1st - 2nd Grade
12 questions
Summer Trivia

Quiz
•
1st - 5th Grade
15 questions
Disney Trivia

Quiz
•
KG - 5th Grade
10 questions
Nouns, Verbs, and Adjectives

Quiz
•
1st - 2nd Grade
13 questions
addition and subtraction

Quiz
•
1st Grade
15 questions
First Grade Ready Math Unit 6 Review

Quiz
•
1st Grade
10 questions
Pixar Short "Piper"

Quiz
•
KG - 2nd Grade