Skip to content

Commit e12d7a8

Browse files
Fix test
1 parent b15dd3b commit e12d7a8

File tree

1 file changed

+32
-31
lines changed

1 file changed

+32
-31
lines changed

v2210/tests/load_web_document_test.go

+32-31
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
1111
* copies of the Software, and to permit persons to whom the Software is
1212
* furnished to do so, subject to the following conditions:
13-
*
13+
*
1414
* The above copyright notice and this permission notice shall be included in all
1515
* copies or substantial portions of the Software.
16-
*
16+
*
1717
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1818
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1919
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -29,41 +29,42 @@
2929
package api_test
3030

3131
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"
3536
)
3637

3738
// Test for loading web document.
3839
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+
}
5254

53-
options := map[string]interface{}{
54-
}
55+
options := map[string]interface{}{}
5556

56-
request := &models.LoadWebDocumentRequest{
57-
Data: &requestData,
58-
Optionals: options,
59-
}
57+
request := &models.LoadWebDocumentRequest{
58+
Data: &requestData,
59+
Optionals: options,
60+
}
6061

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+
}
6566

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.")
6970
}

0 commit comments

Comments
 (0)