Inheritance: NameVerbValueFact
Exemple #1
0
        public void CompareTwoFactsWithDifferentVerbs()
        {
            IsFact fact1 = new IsFact("Temperature", 38);
            IsNotFact fact2 = new IsNotFact("Temperature", 38);

            Assert.AreNotEqual(fact1, fact2);
        }
Exemple #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);
        }
Exemple #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());
        }
Exemple #4
0
 public void TrueFact()
 {
     Fact fact = new IsFact("Temperature", 36);
     Assert.IsTrue(this.world.IsAFact(fact));
 }
Exemple #5
0
 public void RetractAndTestFact()
 {
     Fact fact = new IsFact("Temperature", 36);
     this.world.RetractFact(fact);
     Assert.IsFalse(this.world.IsAFact(fact));
 }
Exemple #6
0
 public void RaiseWhenRetractFalseFact()
 {
     Fact fact = new IsFact("Age", 40);
     this.world.RetractFact(fact);
 }
Exemple #7
0
 public void FalseFact()
 {
     Fact fact = new IsFact("Temperature", 42);
     Assert.IsFalse(this.world.IsAFact(fact));
 }
Exemple #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));
 }
Exemple #9
0
 public void IsNotSatisfiedByNull()
 {
     IsFact fact = new IsFact("Temperature", 38);
     Assert.IsFalse(fact.IsSatisfiedByValue(null));
 }
Exemple #10
0
 public void IsNotSatisfiedByContext()
 {
     IsFact fact = new IsFact("Temperature", 38);
     Context context = new Context();
     Assert.IsFalse(fact.IsSatisfiedByContext(context));
 }
Exemple #11
0
        public void CompareFactWithObject()
        {
            IsFact fact = new IsFact("Temperature", 38);

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

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