// // Created by eran on 02/04/2015. // #pragma once #include #include #include namespace fakeit { class VerifyUnverifiedFunctor { FakeitContext &_fakeit; public: VerifyUnverifiedFunctor(FakeitContext &fakeit) : _fakeit(fakeit) { } template SequenceVerificationProgress operator()(const Sequence &sequence, const list &... tail) { std::vector allSequences{&InvocationUtils::remove_const(sequence), &InvocationUtils::remove_const(tail)...}; std::vector involvedSources; InvocationUtils::collectInvolvedMocks(allSequences, involvedSources); InvocationsSourceProxy aggregateInvocationsSource{new AggregateInvocationsSource(involvedSources)}; InvocationsSourceProxy unverifiedInvocationsSource{ new UnverifiedInvocationsSource(aggregateInvocationsSource)}; UsingProgress usingProgress(_fakeit, unverifiedInvocationsSource); return usingProgress.Verify(sequence, tail...); } }; class UnverifiedFunctor { public: UnverifiedFunctor(FakeitContext &fakeit) : Verify(fakeit) { } VerifyUnverifiedFunctor Verify; template UnverifiedInvocationsSource operator()(const ActualInvocationsSource &head, const list &... tail) { std::vector allMocks{&InvocationUtils::remove_const(head), &InvocationUtils::remove_const(tail)...}; InvocationsSourceProxy aggregateInvocationsSource{new AggregateInvocationsSource(allMocks)}; UnverifiedInvocationsSource unverifiedInvocationsSource{aggregateInvocationsSource}; return unverifiedInvocationsSource; } // template // void operator()(const Sequence &sequence, const list &... tail) { // std::vector allSequences; // collectSequences(allSequences, sequence, tail...); // // std::vector involvedSources; // collectInvolvedMocks(allSequences, involvedSources); // // InvocationsSourceProxy aggregateInvocationsSource{new AggregateInvocationsSource(involvedSources)}; // InvocationsSourceProxy unverifiedInvocationsSource{new UnverifiedInvocationsSource(aggregateInvocationsSource)}; // } }; }