github.com/mdaxf/iac@v0.0.0-20240519030858-58a061660378/workflow/explode_test.go (about)

     1  package workflow
     2  
     3  import (
     4  	"testing"
     5  	// "github.com/mdaxf/iac/controllers/databaseop"
     6  )
     7  
     8  func TestExplodionEngine_Explode(t *testing.T) {
     9  	explosion := NewExplosion("NCR Flow", "NCR", "NCR", "Sys", "abcd")
    10  	data := make(map[string]interface{})
    11  	tests := []struct {
    12  		name        string
    13  		e           *ExplodionEngine
    14  		description string
    15  		data        map[string]interface{}
    16  		wantErr     bool
    17  	}{
    18  		{
    19  			name:        "Test Case 1",
    20  			e:           explosion,
    21  			description: "Test",
    22  			data:        data,
    23  			wantErr:     false,
    24  		},
    25  	}
    26  	for _, tt := range tests {
    27  		t.Run(tt.name, func(t *testing.T) {
    28  			if _, err := tt.e.Explode(tt.description, tt.data); (err != nil) != tt.wantErr {
    29  				t.Errorf("ExplodionEngine.Explode() error = %v, wantErr %v", err, tt.wantErr)
    30  			}
    31  		})
    32  	}
    33  }