예제 #1
0
        public void test_equality()
        {
            var dist = new Distance();

            dist.AddEquality("equality", "ghi", new List <string> {
                "abc", "def", "ghi"
            });
            dist.Penalties.Should().BeEquivalentTo(new Dictionary <string, List <double> > {
                { "equality", new List <double> {
                      0.0
                  } }
            });

            dist.AddEquality("equality", "xyz", new List <string> {
                "abc", "def", "ghi"
            });
            dist.Penalties.Should().BeEquivalentTo(new Dictionary <string, List <double> > {
                { "equality", new List <double> {
                      0.0, 1.0
                  } }
            });

            dist.AddEquality("equality", "abc", new List <string> {
                "abc", "def", "ghi"
            });
            dist.Penalties.Should().BeEquivalentTo(new Dictionary <string, List <double> > {
                { "equality", new List <double> {
                      0.0, 1.0, 0.0
                  } }
            });
        }