removed choco tests

This commit is contained in:
redanthrax 2022-06-28 15:36:59 -07:00
parent 8f27cb1842
commit f42293d494

View file

@ -1,59 +1,59 @@
package choco_test
import (
"errors"
"strings"
"testing"
//import (
//"errors"
//"strings"
//"testing"
"github.com/amidaware/rmmagent/agent/choco"
)
//"github.com/amidaware/rmmagent/agent/choco"
//)
func TestInstallChoco(t *testing.T) {
testTable := []struct {
name string
expectedError error
}{
{
name: "Install Choco",
expectedError: nil,
},
}
//func TestInstallChoco(t *testing.T) {
//testTable := []struct {
//name string
//expectedError error
//}{
//{
//name: "Install Choco",
//expectedError: nil,
//},
//}
for _, tt := range testTable {
t.Run(tt.name, func(t *testing.T) {
err := choco.InstallChoco()
if !errors.Is(tt.expectedError, err) {
t.Errorf("expected error (%v), got (%v)", tt.expectedError, err)
}
})
}
}
//for _, tt := range testTable {
//t.Run(tt.name, func(t *testing.T) {
//err := choco.InstallChoco()
//if !errors.Is(tt.expectedError, err) {
//t.Errorf("expected error (%v), got (%v)", tt.expectedError, err)
//}
//})
//}
//}
func TestInstallWithChoco(t *testing.T) {
testTable := []struct {
name string
software string
expectedString string
expectedError error
}{
{
name: "Install With Choco",
software: "adobereader",
expectedString: "The install of adobereader was successful",
expectedError: nil,
},
}
//func TestInstallWithChoco(t *testing.T) {
//testTable := []struct {
//name string
//software string
//expectedString string
//expectedError error
//}{
//{
//name: "Install With Choco",
//software: "adobereader",
//expectedString: "The install of adobereader was successful",
//expectedError: nil,
//},
//}
for _, tt := range testTable {
t.Run(tt.name, func(t *testing.T) {
result, err := choco.InstallWithChoco(tt.software)
if !errors.Is(tt.expectedError, err) {
t.Errorf("expected (%v), got (%v)", tt.expectedError, err)
}
//for _, tt := range testTable {
//t.Run(tt.name, func(t *testing.T) {
//result, err := choco.InstallWithChoco(tt.software)
//if !errors.Is(tt.expectedError, err) {
//t.Errorf("expected (%v), got (%v)", tt.expectedError, err)
//}
if !strings.Contains(result, tt.expectedString) {
t.Errorf("expected %s, got %s", tt.expectedString, result)
}
})
}
}
//if !strings.Contains(result, tt.expectedString) {
//t.Errorf("expected %s, got %s", tt.expectedString, result)
//}
//})
//}
//}