Exemplo n.º 1
0
    public void HashChanges_WhenChildrenAreDifferent([Values(0, 1, 10)] int childCount)
    {
        var xml1 = CreateXML(childCount);
        var xml2 = CreateXML(childCount + 1);

        Assert.AreNotEqual(XMLHashUtils.Hash(xml1), XMLHashUtils.Hash(xml2));
    }
Exemplo n.º 2
0
    public void HashChanges_WhenRootAttributesAreDifferent([Values("A", "B", "C")] string attributeName)
    {
        var xml1 = CreateXML(1);
        var xml2 = CreateXML(1);

        xml2.Add(new XAttribute(attributeName, "value"));
        Assert.AreNotEqual(XMLHashUtils.Hash(xml1), XMLHashUtils.Hash(xml2));
    }
Exemplo n.º 3
0
    public void HashChanges_WhenRootNameIsDifferent([Values("A", "B", "C")] string nameSuffix)
    {
        var xml1 = CreateXML(1);
        var xml2 = CreateXML(1);

        xml2.Name = xml2.Name + nameSuffix;
        Assert.AreNotEqual(XMLHashUtils.Hash(xml1), XMLHashUtils.Hash(xml2));
    }
Exemplo n.º 4
0
    public void HashIsDeterministic([Values(0, 1, 10)] int childCount)
    {
        var xml = CreateXML(childCount);

        Assert.AreEqual(XMLHashUtils.Hash(xml), XMLHashUtils.Hash(xml));
    }