public void GetTruthValueDictTest() { Variable p = new Variable('p'); Variable q = new Variable('q'); BiImplication a = new BiImplication(p, q); Dictionary <char, bool> dict = new Dictionary <char, bool>(); for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { dict['p'] = i == 1; dict['q'] = j == 1; Assert.AreEqual(i == j, a.GetTruthValue(dict)); } } dict.Remove('p'); Assert.ThrowsException <KeyNotFoundException>( () => a.GetTruthValue(dict)); }
public void GetTruthValueArrayTest() { Variable p = new Variable('p'); Variable q = new Variable('q'); BiImplication a = new BiImplication(p, q); bool[] dict = new bool[130]; for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { dict['p'] = i == 1; dict['q'] = j == 1; Assert.AreEqual(i == j, a.GetTruthValue(dict)); } } }