public void LinguisticVariableEqualsTest() { LinguisticVariable variable = new LinguisticVariable("var", 1, 10); LinguisticVariable equalVariable = new LinguisticVariable("var", 1, 10); Term term = TermsFactory.Instance.CreateTermForVariable("term", variable, new TrapezoidalFunction()); Term term2 = TermsFactory.Instance.CreateTermForVariable("term2", variable, new TriangleFunction()); Term term3 = TermsFactory.Instance.CreateTermForVariable("term3", variable, new GaussianFunction()); Term equalTerm = TermsFactory.Instance.CreateTermForVariable("term", equalVariable, new TrapezoidalFunction()); Term equalTerm2 = TermsFactory.Instance.CreateTermForVariable("term2", equalVariable, new TriangleFunction()); Term equalTerm3 = TermsFactory.Instance.CreateTermForVariable("term3", equalVariable, new GaussianFunction()); Assert.IsTrue(variable.Equals(equalVariable)); LinguisticVariable notEqualVariable = new LinguisticVariable("var", 1, 10); Term notEqualTerm = TermsFactory.Instance.CreateTermForVariable("term", notEqualVariable, new TrapezoidalFunction()); Term notEqualTerm2 = TermsFactory.Instance.CreateTermForVariable("term2", notEqualVariable, new TriangleFunction()); Term notEqualTerm3 = TermsFactory.Instance.CreateTermForVariable("term4", notEqualVariable, new GaussianFunction()); Assert.IsFalse(variable.Equals(notEqualVariable)); }