Skip to content

Commit

Permalink
tests: excel: bigger coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
vdjagilev committed Feb 23, 2024
1 parent b428bf8 commit 2da6952
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
1 change: 0 additions & 1 deletion formatter/formatter_excel.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ func (cd *CellData) writeCell(cell string, value string) error {

// Format the data to Excel and output it to an Excel file
func (f *ExcelFormatter) Format(td *TemplateData, templateContent string) (err error) {
// TODO: Write unit tests
file := excelize.NewFile()
sheetName := "Sheet1"

Expand Down
30 changes: 28 additions & 2 deletions formatter/formatter_excel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,39 @@ func TestExcelFormatter_Format(t *testing.T) {
{
StartTime: 0,
EndTime: 0,
Port: []Port{},
Port: []Port{
{
PortID: 80,
Protocol: "tcp",
Service: PortService{
Name: "http",
},
},
{
PortID: 443,
Protocol: "tcp",
Service: PortService{
Name: "https",
},
},
},
HostAddress: []HostAddress{
{
Address: "192.168.1.1",
},
},
HostNames: HostNames{},
HostNames: HostNames{
HostName: []HostName{
{
Name: "example.com",
Type: "",
},
{
Name: "www.example.com",
Type: "",
},
},
},
Status: HostStatus{
State: "up",
},
Expand Down

0 comments on commit 2da6952

Please sign in to comment.