1 : // Copyright 2014 Google Inc. All Rights Reserved.
2 : //
3 : // Licensed under the Apache License, Version 2.0 (the "License");
4 : // you may not use this file except in compliance with the License.
5 : // You may obtain a copy of the License at
6 : //
7 : // http://www.apache.org/licenses/LICENSE-2.0
8 : //
9 : // Unless required by applicable law or agreed to in writing, software
10 : // distributed under the License is distributed on an "AS IS" BASIS,
11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 : // See the License for the specific language governing permissions and
13 : // limitations under the License.
14 :
15 : #ifndef SYZYGY_KASKO_INTERNET_UNITTEST_HELPERS_H_
16 : #define SYZYGY_KASKO_INTERNET_UNITTEST_HELPERS_H_
17 :
18 : #include <map>
19 : #include <string>
20 :
21 : #include "base/strings/string16.h"
22 :
23 m : namespace kasko {
24 :
25 : // Verifies that the supplied multipart MIME message body is plausibly
26 : // formatted. Adds non-fatal GTest failures if verification fails.
27 : // @param boundary The boundary specified in the Content-Type header that
28 : // accompanied the body.
29 : // @param parameters The parameters that are expected to be encoded in the body.
30 : // @param file The file contents that are expdected to be encoded in the body.
31 : // @param file_part_name The name expected to be assigned to the file parameter.
32 m : void ExpectMultipartMimeMessageIsPlausible(
33 m : const base::string16& boundary,
34 m : const std::map<base::string16, base::string16>& parameters,
35 m : const std::string& file,
36 m : const std::string& file_part_name,
37 m : const std::string& body);
38 :
39 m : } // namespace kasko
40 :
41 : #endif // SYZYGY_KASKO_INTERNET_UNITTEST_HELPERS_H_
|