示例#1
0
            public void _2_1_4Combine_ForLength3FromBinaryValues_Success()
            {
                var k        = 3;
                var testable = new _2_1_4();
                var expected = new[] { "000", "001", "002", "010", "011", "012" };

                var result = testable.Run(k);

                Assert.That(result.Select(x => string.Join("", x)).ToArray(), Is.EquivalentTo(expected));
            }
示例#2
0
            public void PropertyCombine_AnyInputValues_DifferenceShouldBeConstantForAllValues()
            {
                var testable = new _2_1_4();

                Prop.ForAll(
                    Arb.From <int>().Filter(x => x > 0 && x < 7),
                    k =>
                {
                    var result       = testable.Run(k).Select(x => x.ToList()).ToList();
                    var analogResult = testable.SimpleAnalog(k, 0);

                    for (var i = 0; i < result.Count; i++)
                    {
                        Assert.That(result[i].SequenceEqual(analogResult[i]));
                    }
                }).QuickCheckThrowOnFailure();
            }