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

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

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

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