|
10 | 10 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
11 | 11 | * copies of the Software, and to permit persons to whom the Software is
|
12 | 12 | * furnished to do so, subject to the following conditions:
|
13 |
| - * |
| 13 | + * |
14 | 14 | * The above copyright notice and this permission notice shall be included in all
|
15 | 15 | * copies or substantial portions of the Software.
|
16 |
| - * |
| 16 | + * |
17 | 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
18 | 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
19 | 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
29 | 29 | package api_test
|
30 | 30 |
|
31 | 31 | import (
|
32 |
| - "github.com/stretchr/testify/assert" |
33 |
| - "testing" |
34 |
| - "github.com/aspose-words-cloud/aspose-words-cloud-go/v2210/api/models" |
| 32 | + "testing" |
| 33 | + |
| 34 | + "github.com/aspose-words-cloud/aspose-words-cloud-go/v2210/api/models" |
| 35 | + "github.com/stretchr/testify/assert" |
35 | 36 | )
|
36 | 37 |
|
37 | 38 | // Test for loading web document.
|
38 | 39 | func Test_LoadWebDocument_LoadWebDocument(t *testing.T) {
|
39 |
| - config := ReadConfiguration(t) |
40 |
| - client, ctx := PrepareTest(t, config) |
41 |
| - requestDataSaveOptions := models.DocSaveOptionsData{ |
42 |
| - FileName: ToStringPointer("google.doc"), |
43 |
| - DmlEffectsRenderingMode: ToStringPointer("None"), |
44 |
| - DmlRenderingMode: ToStringPointer("DrawingML"), |
45 |
| - UpdateSdtContent: ToBoolPointer(false), |
46 |
| - ZipOutput: ToBoolPointer(false), |
47 |
| - } |
48 |
| - requestData := models.LoadWebDocumentData{ |
49 |
| - LoadingDocumentUrl: ToStringPointer("http://google.com"), |
50 |
| - SaveOptions: &requestDataSaveOptions, |
51 |
| - } |
| 40 | + config := ReadConfiguration(t) |
| 41 | + client, ctx := PrepareTest(t, config) |
| 42 | + requestDataSaveOptions := models.DocSaveOptionsData{ |
| 43 | + FileName: ToStringPointer("google.doc"), |
| 44 | + DmlEffectsRenderingMode: ToStringPointer("None"), |
| 45 | + DmlRenderingMode: ToStringPointer("DrawingML"), |
| 46 | + UpdateSdtContent: ToBoolPointer(false), |
| 47 | + ZipOutput: ToBoolPointer(false), |
| 48 | + SaveFormat: ToStringPointer("text"), |
| 49 | + } |
| 50 | + requestData := models.LoadWebDocumentData{ |
| 51 | + LoadingDocumentUrl: ToStringPointer("http://google.com"), |
| 52 | + SaveOptions: &requestDataSaveOptions, |
| 53 | + } |
52 | 54 |
|
53 |
| - options := map[string]interface{}{ |
54 |
| - } |
| 55 | + options := map[string]interface{}{} |
55 | 56 |
|
56 |
| - request := &models.LoadWebDocumentRequest{ |
57 |
| - Data: &requestData, |
58 |
| - Optionals: options, |
59 |
| - } |
| 57 | + request := &models.LoadWebDocumentRequest{ |
| 58 | + Data: &requestData, |
| 59 | + Optionals: options, |
| 60 | + } |
60 | 61 |
|
61 |
| - actual, _, err := client.WordsApi.LoadWebDocument(ctx, request) |
62 |
| - if err != nil { |
63 |
| - t.Error(err) |
64 |
| - } |
| 62 | + actual, _, err := client.WordsApi.LoadWebDocument(ctx, request) |
| 63 | + if err != nil { |
| 64 | + t.Error(err) |
| 65 | + } |
65 | 66 |
|
66 |
| - assert.NotNil(t, actual.SaveResult, "Validate LoadWebDocument response."); |
67 |
| - assert.NotNil(t, actual.SaveResult.DestDocument, "Validate LoadWebDocument response."); |
68 |
| - assert.Equal(t, "google.doc", actual.SaveResult.DestDocument.Href, "Validate LoadWebDocument response."); |
| 67 | + assert.NotNil(t, actual.SaveResult, "Validate LoadWebDocument response.") |
| 68 | + assert.NotNil(t, actual.SaveResult.DestDocument, "Validate LoadWebDocument response.") |
| 69 | + assert.Equal(t, "google.doc", actual.SaveResult.DestDocument.Href, "Validate LoadWebDocument response.") |
69 | 70 | }
|
0 commit comments