Esempio n. 1
0
        public void test_add_priority_value()
        {
            var dist = new Distance();

            dist.AddPriority("priority", "abc", new List <string> {
                "abc"
            });
            dist.Penalties.Should().BeEquivalentTo(new Dictionary <string, List <double> > {
                { "priority", new List <double> {
                      0.0
                  } }
            });

            dist.AddPriority("priority", "def", new List <string> {
                "abc", "def"
            });
            dist.Penalties.Should().BeEquivalentTo(new Dictionary <string, List <double> > {
                { "priority", new List <double> {
                      0.0, 0.5
                  } }
            });

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