Inheritance: NameVerbValueFact
Exemplo n.º 1
0
        public void CompareTwoFactsWithDifferentVerbs()
        {
            IsFact fact1 = new IsFact("Temperature", 38);
            IsNotFact fact2 = new IsNotFact("Temperature", 38);

            Assert.AreNotEqual(fact1, fact2);
        }
Exemplo n.º 2
0
        public void CreateIsFact()
        {
            IsFact fact = new IsFact("Temperature", 38);

            Assert.AreEqual("Temperature", fact.Name);
            Assert.AreEqual(38, fact.Value);
            Assert.AreEqual("is", fact.Verb);
        }
Exemplo n.º 3
0
        public void CompareTwoEqualFactsWithNullValue()
        {
            IsFact fact1 = new IsFact("Temperature", null);
            IsFact fact2 = new IsFact("Temperature", null);

            Assert.AreEqual(fact1, fact2);
            Assert.AreEqual(fact1.GetHashCode(), fact2.GetHashCode());
        }
Exemplo n.º 4
0
 public void TrueFact()
 {
     Fact fact = new IsFact("Temperature", 36);
     Assert.IsTrue(this.world.IsAFact(fact));
 }
Exemplo n.º 5
0
 public void RetractAndTestFact()
 {
     Fact fact = new IsFact("Temperature", 36);
     this.world.RetractFact(fact);
     Assert.IsFalse(this.world.IsAFact(fact));
 }
Exemplo n.º 6
0
 public void RaiseWhenRetractFalseFact()
 {
     Fact fact = new IsFact("Age", 40);
     this.world.RetractFact(fact);
 }
Exemplo n.º 7
0
 public void FalseFact()
 {
     Fact fact = new IsFact("Temperature", 42);
     Assert.IsFalse(this.world.IsAFact(fact));
 }
Exemplo n.º 8
0
 public void AssertTwiceRetractAndTestFact()
 {
     Fact fact = new IsFact("Age", 40);
     this.world.AssertFact(fact);
     this.world.AssertFact(new IsFact("Age", 40));
     this.world.RetractFact(fact);
     Assert.IsFalse(this.world.IsAFact(fact));
 }
Exemplo n.º 9
0
 public void IsNotSatisfiedByNull()
 {
     IsFact fact = new IsFact("Temperature", 38);
     Assert.IsFalse(fact.IsSatisfiedByValue(null));
 }
Exemplo n.º 10
0
 public void IsNotSatisfiedByContext()
 {
     IsFact fact = new IsFact("Temperature", 38);
     Context context = new Context();
     Assert.IsFalse(fact.IsSatisfiedByContext(context));
 }
Exemplo n.º 11
0
        public void CompareFactWithObject()
        {
            IsFact fact = new IsFact("Temperature", 38);

            Assert.AreNotEqual(fact, 38);
        }
Exemplo n.º 12
0
        public void CompareFactWithNull()
        {
            IsFact fact = new IsFact("Temperature", 38);

            Assert.IsFalse(fact.Equals(null));
        }
Exemplo n.º 13
0
 public void IsSatisfiedByValue()
 {
     IsFact fact = new IsFact("Temperature", 38);
     Assert.IsTrue(fact.IsSatisfiedByValue(38));
 }
Exemplo n.º 14
0
 public void IsSatisfiedByNullWhenNull()
 {
     IsFact fact = new IsFact("Temperature", null);
     Assert.IsTrue(fact.IsSatisfiedByValue(null));
 }
Exemplo n.º 15
0
 public void IsSatisfiedByContext()
 {
     IsFact fact = new IsFact("Temperature", 38);
     Context context = new Context();
     context.SetValue("Temperature", 38);
     Assert.IsTrue(fact.IsSatisfiedByContext(context));
 }