Пример #1
0
        public void IsThresholdShareShorterTestFail()
        {
            //assign
            var nothresholdAccess = "P1^P2,P2^P3,P3^p4,p4^p5,p5^p6,p6^p7,p7^p8,p8^p1";
            var tryIntersect      = true;
            //arrange
            AccessStructure a          = new AccessStructure(nothresholdAccess);
            var             thresholds = new List <ThresholdSubset>();
            var             remaining  = new List <QualifiedSubset>();

            ThresholdHelper.DetectThresholds(a, tryIntersect, out thresholds, out remaining);
            bool isEfficicent = ThresholdHelper.IsThresholdShareShorter(a, thresholds, remaining);

            //assert
            Assert.IsFalse(isEfficicent);
        }
Пример #2
0
        public void IsThresholdShareShorterTestPass()
        {
            //assign
            var nothresholdAccess = "p1^p2^p3,p2^p3^p4,p1^p3^p4,p1^p2^p4,p4^p5^p6,p4^p5^p7,p4^p6^p7";
            var tryIntersect      = true;
            //arrange
            AccessStructure a          = new AccessStructure(nothresholdAccess);
            var             thresholds = new List <ThresholdSubset>();
            var             remaining  = new List <QualifiedSubset>();

            ThresholdHelper.DetectThresholds(a, tryIntersect, out thresholds, out remaining);
            bool isEfficicent = ThresholdHelper.IsThresholdShareShorter(a, thresholds, remaining);

            //assert
            Assert.IsTrue(isEfficicent);
        }