github.com/LanderTome/numerologyCalculator@v1.0.2/numerology/karmicLesson_test.go (about)

     1  // Copyright 2021 Robert D. Wukmir
     2  // This file is subject to the terms and conditions defined in
     3  // the LICENSE file, which is part of this source code package.
     4  //
     5  // Unless required by applicable law or agreed to in writing,
     6  // software distributed under the License is distributed on an
     7  // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
     8  // either express or implied. See the License for the specific
     9  // language governing permissions and limitations under the
    10  // License.
    11  
    12  package numerology
    13  
    14  import (
    15  	"reflect"
    16  	"testing"
    17  )
    18  
    19  func Test_karmicLesson(t *testing.T) {
    20  	type args struct {
    21  		name         string
    22  		numberSystem NumberSystem
    23  	}
    24  	tests := []struct {
    25  		name string
    26  		args args
    27  		want KarmicLessonResults
    28  	}{
    29  		{"Alphabet", args{"abcdefghijklmnopqrstuvwxyz", Pythagorean}, KarmicLessonResults{
    30  			Numbers: []int{},
    31  		}},
    32  		{"Only One Letter", args{"a", Pythagorean}, KarmicLessonResults{
    33  			Numbers: []int{2, 3, 4, 5, 6, 7, 8, 9},
    34  		}},
    35  	}
    36  	for _, tt := range tests {
    37  		t.Run(tt.name, func(t *testing.T) {
    38  			counts, _, _ := countNumerologicalNumbers(tt.args.name, tt.args.numberSystem)
    39  			if got := karmicLessons(counts); !reflect.DeepEqual(got, tt.want) {
    40  				t.Errorf("karmicLessons() = %v, want %v", got, tt.want)
    41  			}
    42  		})
    43  	}
    44  }