public void Length_ReturnsLengthOfValue(string value1, string value2, string expectedValue) { var sut = new WordCombination(new Word(value1), new Word(value2)); var actual = sut.Value; Assert.That(actual, Is.EqualTo(expectedValue)); }
public void ObjectsWithWordsInReversedOrder_AreNotEqual() { var obj1 = new WordCombination(_word1, _word2); var obj2 = new WordCombination(_word2, _word1); Assert.That(!obj1.Equals(obj2)); Assert.That(obj1 != obj2); }
public void NullInstances_AreEqual() { WordCombination obj1 = null; WordCombination obj2 = null; Assert.That(Equals(obj1, obj2)); Assert.That(obj1 == obj2); }
public void IsNotEqualToNull() { var obj1 = new WordCombination(_word1, _word2); WordCombination obj2 = null; Assert.That(!Equals(obj1, obj2)); Assert.That(obj1 != obj2); }
public void ToString_ReturnsValue() { var expected = $"{_word1.Value} + {_word2.Value} => {_word1.Value + _word2.Value}"; var sut = new WordCombination(_word1, _word2); var actual = sut.ToString(); Assert.That(actual, Is.EqualTo(expected)); }
public void ObjectsWithDifferentWords_AreNotEqual() { var obj1 = new WordCombination(_word1, _word2); var obj2 = new WordCombination(_word1, _word3); Assert.That(!obj1.Equals(obj2)); Assert.That(obj1 != obj2); }
public void ObjectsWithEqualWords_AreEqual() { var obj1 = new WordCombination(_word1, _word2); var obj2 = new WordCombination(_word1, _word2); Assert.That(obj1.Equals(obj2)); Assert.That(obj1 == obj2); Assert.That(obj1.GetHashCode() == obj2.GetHashCode()); }
protected bool Equals(WordCombination other) { return(_left.Equals(other._left) && _right.Equals(other._right)); }