...

Source file src/github.com/letsencrypt/boulder/ratelimits/names_test.go

Documentation: github.com/letsencrypt/boulder/ratelimits

     1  package ratelimits
     2  
     3  import (
     4  	"testing"
     5  
     6  	"github.com/letsencrypt/boulder/test"
     7  )
     8  
     9  func TestNameIsValid(t *testing.T) {
    10  	t.Parallel()
    11  	type args struct {
    12  		name Name
    13  	}
    14  	tests := []struct {
    15  		name string
    16  		args args
    17  		want bool
    18  	}{
    19  		{name: "Unknown", args: args{name: Unknown}, want: false},
    20  		{name: "9001", args: args{name: 9001}, want: false},
    21  		{name: "NewRegistrationsPerIPAddress", args: args{name: NewRegistrationsPerIPAddress}, want: true},
    22  	}
    23  	for _, tt := range tests {
    24  		t.Run(tt.name, func(t *testing.T) {
    25  			got := tt.args.name.isValid()
    26  			test.AssertEquals(t, tt.want, got)
    27  		})
    28  	}
    29  }
    30  

View as plain text