public void AndNot_ReturnsConjunction_WithNegationRight() { var spec1 = new IntegerGreaterThanZero(); var spec2 = new IntegerLessThanZero(); var conjoinedSpec = spec1.AndNot(spec2); Assert.That(conjoinedSpec, Is.TypeOf<Conjunction<int>>()); Assert.That(conjoinedSpec, Has.Property("Left").EqualTo(spec1)); Assert.That(conjoinedSpec, Has.Property("Right").TypeOf<Negation<int>>()); Assert.That(conjoinedSpec, Has.Property("Right").With.Property("Inner").EqualTo(spec2)); }
public void AndOperator_ReturnsConjunction() { var spec1 = new IntegerGreaterThanZero(); var spec2 = new IntegerLessThanZero(); var conjoinedSpec = spec1 & spec2; Assert.That(conjoinedSpec, Is.TypeOf<Conjunction<int>>()); Assert.That(conjoinedSpec, Has.Property("Left").EqualTo(spec1)); Assert.That(conjoinedSpec, Has.Property("Right").EqualTo(spec2)); }
public void Xor_ReturnsExclusiveDisjunction() { var spec1 = new IntegerGreaterThanZero(); var spec2 = new IntegerLessThanZero(); var conjoinedSpec = spec1.Xor(spec2); Assert.That(conjoinedSpec, Is.TypeOf<ExclusiveDisjunction<int>>()); Assert.That(conjoinedSpec, Has.Property("Left").EqualTo(spec1)); Assert.That(conjoinedSpec, Has.Property("Right").EqualTo(spec2)); }