Debian Codegraph @

src/vendor/azure-uamqp-c/deps/azure-c-shared-utility/testtools/micromock/inc/mockmethodcallbase.h

raw
1 // Copyright (c) Microsoft. All rights reserved.
2 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
3
4 #ifndef MOCKMETHODCALLBASE_H
5 #define MOCKMETHODCALLBASE_H
6
7 #pragma once
8
9 #include "stdafx.h"
10 #include "mockvaluebase.h"
11 #include "mockcallargumentbase.h"
12
13 class CMockMethodCallBase
14 {
15 public:
16 CMockMethodCallBase();
17 virtual ~CMockMethodCallBase();
18 CMockMethodCallBase(std::tstring methodName, size_t argCount = 0,
19 CMockCallArgumentBase** arguments = NULL);
20
21 std::tstring ToString();
22 std::tstring GetArgumentsString();
23 bool operator==(const CMockMethodCallBase& right);
24 void CopyOutArgumentBuffers(CMockMethodCallBase* sourceMockMethodCall);
25 void AddExtraCallArgument(CMockCallArgumentBase* callArgument);
26
27 CMockMethodCallBase* m_MatchedCall;
28 bool m_OnlySpecifiesActions;
29 bool m_IgnoreAllCalls;
30 bool m_AlwaysReport;
31 size_t m_ExpectedTimes;
32 size_t m_MatchedTimes;
33 bool m_ExactExpectedTimes;
34 virtual CMockValueBase* GetReturnValue() { return m_ReturnValue; }
35 virtual CMockValueBase* GetFailReturnValue()
36 {
37 return m_FailReturnValue;
38 }
39 bool HasMatch() const { return (NULL != m_MatchedCall); }
40 void RollbackMatch();
41
42 protected:
43 void Init(std::tstring methodName);
44
45 std::vector<CMockCallArgumentBase*> m_MockCallArguments;
46 std::tstring m_MethodName;
47 CMockValueBase* m_ReturnValue;
48 CMockValueBase* m_FailReturnValue;
49 };
50
51 #endif // MOCKMETHODCALLBASE_H