Exemplo n.º 1
0
    public void should_correctly_add_relationships()
    {
        var expectedWeight = -0.8f;
        var illegalTag     = 1;
        var lawfulTag      = 2;

        var tagRegistry = new TagRegistry();

        tagRegistry.AddRelationship(illegalTag, lawfulTag, expectedWeight);

        Assert.Equal(1, tagRegistry.TagRelations.Count);
        Assert.True(tagRegistry.TagRelations.ContainsKey(illegalTag));
        Assert.Equal(1, tagRegistry.TagRelations[illegalTag].Count);
        Assert.Equal(new TagWeighting(lawfulTag, expectedWeight), tagRegistry.TagRelations[illegalTag].First());
    }