github.com/mdaxf/iac@v0.0.0-20240519030858-58a061660378/framework/notification/sendemail_test.go (about)

     1  package email
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  func TestSendEmail(t *testing.T) {
     8  	type args struct {
     9  		emailConfig EmailConfiguration
    10  		to          []string
    11  		subject     string
    12  		body        string
    13  	}
    14  	tests := []struct {
    15  		name    string
    16  		args    args
    17  		wantErr bool
    18  	}{
    19  		// TODO: Add test cases.
    20  	}
    21  	for _, tt := range tests {
    22  		t.Run(tt.name, func(t *testing.T) {
    23  			if err := SendEmail(tt.args.emailConfig, tt.args.to, tt.args.subject, tt.args.body); (err != nil) != tt.wantErr {
    24  				t.Errorf("SendEmail() error = %v, wantErr %v", err, tt.wantErr)
    25  			}
    26  		})
    27  	}
    28  }
    29  
    30  func TestSendEmailWithAttachment(t *testing.T) {
    31  	type args struct {
    32  		emailConfig EmailConfiguration
    33  		to          []string
    34  		subject     string
    35  		body        string
    36  		attachment  string
    37  	}
    38  	tests := []struct {
    39  		name    string
    40  		args    args
    41  		wantErr bool
    42  	}{
    43  		// TODO: Add test cases.
    44  	}
    45  	for _, tt := range tests {
    46  		t.Run(tt.name, func(t *testing.T) {
    47  			if err := SendEmailWithAttachment(tt.args.emailConfig, tt.args.to, tt.args.subject, tt.args.body, tt.args.attachment); (err != nil) != tt.wantErr {
    48  				t.Errorf("SendEmailWithAttachment() error = %v, wantErr %v", err, tt.wantErr)
    49  			}
    50  		})
    51  	}
    52  }