示例#1
0
        public void FixedLengthTest()
        {
            var generator = new ArbitraryVariationGenerator("01", 2, 2);

            var actual   = generator.GetVariationsString();
            var expected = new StringBuilder();

            expected.AppendLine("00");
            expected.AppendLine("10");
            expected.AppendLine("01");
            expected.AppendLine("11");

            Assert.Equal(expected.ToString(), actual);
            Assert.Equal <ulong>(4, generator.VariationNumber);
            Assert.Equal <ulong>(4, generator.LoopNumber);
            Assert.Equal <ulong>(4, generator.LoopCount);
        }
示例#2
0
        public void FixedLengthNoDuplicatesTest()
        {
            var supressor = new AdjacentDuplicatesSuppressor();
            var generator = new ArbitraryVariationGenerator("01", 2, 2,
                                                            CharCase.AsDefined, new List <ISuppressor> {
                supressor
            });

            var actual   = generator.GetVariationsString();
            var expected = new StringBuilder();

            expected.AppendLine("10");
            expected.AppendLine("01");

            Assert.Equal(expected.ToString(), actual);
            Assert.Equal <ulong>(2, generator.VariationNumber);
            Assert.Equal <ulong>(4, generator.LoopNumber);
            Assert.Equal <ulong>(4, generator.LoopCount);
        }