public void Should_BeEqual_When_SessionMetricEqualsSessionMetric() { var sessionMetric = SessionMetric.Counters.CqlClientTimeouts; IMetric metric = sessionMetric; IMetric metric2 = sessionMetric; Assert.IsTrue(sessionMetric.Equals(metric)); Assert.IsTrue(metric.Equals(sessionMetric)); Assert.IsTrue(metric.Equals(metric2)); Assert.IsTrue(sessionMetric.Equals(SessionMetric.Counters.CqlClientTimeouts)); }
public void Should_BeEqual_When_NodeMetricEqualsNodeMetric() { var nodeMetric = NodeMetric.Counters.AuthenticationErrors; IMetric metric = nodeMetric; IMetric metric2 = nodeMetric; Assert.IsTrue(nodeMetric.Equals(metric)); Assert.IsTrue(metric.Equals(nodeMetric)); Assert.IsTrue(metric.Equals(metric2)); Assert.IsTrue(nodeMetric.Equals(NodeMetric.Counters.AuthenticationErrors)); }
public void Should_NotBeEqual_WhenCustomMetricEqualsSessionMetric() { var sessionMetric = new SessionMetric(NodeMetric.Counters.AuthenticationErrors.Name); IMetric sessionMetricBase = sessionMetric; IMetric sessionMetricBase2 = sessionMetric; var testMetric = new TestMetric { Name = NodeMetric.Counters.AuthenticationErrors.Name }; IMetric testMetricBase = testMetric; IMetric testMetricBase2 = testMetric; Assert.IsFalse(testMetric.Equals(sessionMetric)); Assert.IsFalse(sessionMetric.Equals(testMetric)); Assert.IsFalse(testMetric.Equals(sessionMetricBase)); Assert.IsFalse(sessionMetricBase.Equals(testMetric)); Assert.IsFalse(testMetric.Equals(sessionMetricBase2)); Assert.IsFalse(sessionMetricBase2.Equals(testMetric)); Assert.IsFalse(testMetricBase.Equals(sessionMetric)); Assert.IsFalse(sessionMetric.Equals(testMetricBase)); Assert.IsFalse(testMetricBase.Equals(sessionMetricBase)); Assert.IsFalse(sessionMetricBase.Equals(testMetricBase)); Assert.IsFalse(testMetricBase.Equals(sessionMetricBase2)); Assert.IsFalse(sessionMetricBase2.Equals(testMetricBase)); Assert.IsFalse(testMetricBase2.Equals(sessionMetric)); Assert.IsFalse(sessionMetric.Equals(testMetricBase2)); Assert.IsFalse(testMetricBase2.Equals(sessionMetricBase)); Assert.IsFalse(sessionMetricBase.Equals(testMetricBase2)); Assert.IsFalse(testMetricBase2.Equals(sessionMetricBase2)); Assert.IsFalse(sessionMetricBase2.Equals(testMetricBase2)); }
public void Should_NotBeEqual_WhenNodeMetricEqualsSessionMetric() { var sessionMetric = new SessionMetric(NodeMetric.Counters.AuthenticationErrors.Name); IMetric sessionMetricBase = sessionMetric; IMetric sessionMetricBase2 = sessionMetric; var nodeMetric = NodeMetric.Counters.AuthenticationErrors; IMetric nodeMetricBase = nodeMetric; IMetric nodeMetricBase2 = nodeMetric; Assert.IsFalse(nodeMetric.Equals(sessionMetric)); Assert.IsFalse(sessionMetric.Equals(nodeMetric)); Assert.IsFalse(nodeMetric.Equals(sessionMetricBase)); Assert.IsFalse(sessionMetricBase.Equals(nodeMetric)); Assert.IsFalse(nodeMetric.Equals(sessionMetricBase2)); Assert.IsFalse(sessionMetricBase2.Equals(nodeMetric)); Assert.IsFalse(nodeMetricBase.Equals(sessionMetric)); Assert.IsFalse(sessionMetric.Equals(nodeMetricBase)); Assert.IsFalse(nodeMetricBase.Equals(sessionMetricBase)); Assert.IsFalse(sessionMetricBase.Equals(nodeMetricBase)); Assert.IsFalse(nodeMetricBase.Equals(sessionMetricBase2)); Assert.IsFalse(sessionMetricBase2.Equals(nodeMetricBase)); Assert.IsFalse(nodeMetricBase2.Equals(sessionMetric)); Assert.IsFalse(sessionMetric.Equals(nodeMetricBase2)); Assert.IsFalse(nodeMetricBase2.Equals(sessionMetricBase)); Assert.IsFalse(sessionMetricBase.Equals(nodeMetricBase2)); Assert.IsFalse(nodeMetricBase2.Equals(sessionMetricBase2)); Assert.IsFalse(sessionMetricBase2.Equals(nodeMetricBase2)); }