public void CanCalculateSatisfaction() { var reality = new int[] { 1, 2, 3 }; var goal = new int[] { 3, 1, 2 }; var result = Satisfaction.Calculate(reality, goal); var possible = Satisfaction.Scale.Value(1) + Satisfaction.Scale.Value(2) + Satisfaction.Scale.Value(3); var actual = Satisfaction.Scale.Value(3) // 3: Goal was 1st, but reality was 3rd + Satisfaction.Scale.Value(2) // 1: Goal was 2nd, reality was 1st, so expectation was 2nd + Satisfaction.Scale.Value(3); // 2: Goal was 3rd, reality was 1st, so expectation was 3rd var expected = (int)((decimal)actual / possible * 100); Assert.Equal(expected, result);//69% }