Skip to content

Commit 8916d16

Browse files
committed
add test case.
1 parent 117596f commit 8916d16

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

api_cells.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import (
3333
)
3434

3535
func Version() {
36-
fmt.Println("---Version: 23.4---")
36+
fmt.Println("---Version: 23.8---")
3737
}
3838

3939
/*

api_cells_lightcells_test.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5199,6 +5199,33 @@ func TestLightCells_PostProtect(t *testing.T) {
51995199
}
52005200
}
52015201

5202+
func TestLightCells_PostProtectRequestion(t *testing.T) {
5203+
5204+
assemblyTestXlsx := "assemblytest.xlsx"
5205+
dataSourceXlsx := "datasource.xlsx"
5206+
5207+
var mapFiles map[string]string
5208+
mapFiles = make(map[string]string)
5209+
5210+
mapFiles[assemblyTestXlsx] = GetBaseTest().localTestDataFolder + assemblyTestXlsx
5211+
mapFiles[dataSourceXlsx] = GetBaseTest().localTestDataFolder + dataSourceXlsx
5212+
5213+
request := new(PostProtectRequest)
5214+
request.File = mapFiles
5215+
var protectWorkbookRequst = new(ProtectWorkbookRequst)
5216+
protectWorkbookRequst.AwaysOpenOnlyReady = true
5217+
request.ProtectWorkbookRequst = protectWorkbookRequst
5218+
5219+
_, httpResponse, err := GetBaseTest().CellsApi.PostProtect(request)
5220+
if err != nil {
5221+
t.Error(err)
5222+
} else if httpResponse.StatusCode < 200 || httpResponse.StatusCode > 299 {
5223+
t.Fail()
5224+
} else {
5225+
fmt.Printf("%d\tTestLightCells_PostProtect \n", GetBaseTest().GetTestNumber())
5226+
}
5227+
}
5228+
52025229
func TestLightCells_PostSearch(t *testing.T) {
52035230

52045231
assemblyTestXlsx := "assemblytest.xlsx"

0 commit comments

Comments
 (0)