コード例 #1
0
        public void LamaCalculatesProperlySingleElement()
        {
            var set = this.GetReferenceSet();
            var cardinalities = new SortedList<TwoTuple, int>();
            cardinalities.Add(new TwoTuple(set[2], 0.33m), 5);

            ILamaCalculator lamaCalculator = new LamaCalculator();
            TwoTuple result = lamaCalculator.LinguisticLama(cardinalities, set);

            Assert.NotNull(result);
            Assert.AreEqual(set[2], result.Label);
            Assert.AreEqual(0.33m, result.Alpha);
        }
コード例 #2
0
 public void LamaThrowsIfEmtpyCardinalities()
 {
     ILamaCalculator lamaCalculator = new LamaCalculator();
     Assert.Throws<ArgumentNullException>(() => lamaCalculator.LinguisticLama(null, new LabelSet()));
 }
コード例 #3
0
 public void LamaThrowsIfEmptyReferenceSet()
 {
     ILamaCalculator lamaCalculator = new LamaCalculator();
     Assert.Throws<ArgumentNullException>(() => lamaCalculator.LinguisticLama(new SortedList<TwoTuple, int>(), null));
 }
コード例 #4
0
 public void LamaThrowsIfEmptyArguments()
 {
     ILamaCalculator lamaCalculator = new LamaCalculator();
     Assert.Throws<ArgumentNullException>(() => lamaCalculator.LinguisticLama(null, null));
 }