public void DistanceBetween() { var strat = new GraphSpeciationStrategy(1, 10, 100, 1000, 10000, Dist, Dist); double expVertDist = (1 * 10) + (nVertMismatch * 1000 / 4); double expEdgeDist = (1 * 100) + (nEdgeMismatch * 10000 / 3); double expected = expVertDist + expEdgeDist; double actualDist = strat.DistanceBetween(Graph1, Graph2); Assert.AreEqual(expected, actualDist, float.Epsilon); }
public void Constructors() { Assert.ThrowsException <ArgumentNullException>( () => new GraphSpeciationStrategy(0, 0, 0, null, Dist)); Assert.ThrowsException <ArgumentNullException>( () => new GraphSpeciationStrategy(0, 0, 0, Dist, null)); var strat = new GraphSpeciationStrategy(1, 2, 3, Dist, Dist); Assert.AreEqual(1, strat.DistanceThreshold); Assert.AreEqual(2, strat.VertexMatchWeight); Assert.AreEqual(2, strat.EdgeMatchWeight); Assert.AreEqual(3, strat.VertexMismatchWeight); Assert.AreEqual(3, strat.EdgeMismatchWeight); Assert.AreSame(Dist, strat.VertexDistanceFunc); Assert.AreSame(Dist, strat.EdgeDistanceFunc); }