コード例 #1
0
        public void ContentOfItems_5()
        {
            StringDivider sut    = new StringDivider();
            var           result = sut.Divide("aabbccdef", 5);

            Assert.That(result[0], Is.EqualTo(new MaybeString("aabbccde")));
            Assert.That(result[1], Is.EqualTo(new MaybeString("bbccdef")));
        }
コード例 #2
0
 public void AndCardinalityIsGreaterThanCountOfDistinctLetters_ExceptionIsThrown()
 {
     Assert.Throws <ArgumentException>(() =>
     {
         var sut = new StringDivider();
         sut.Divide("aaaaabb", 3);
     });
 }
コード例 #3
0
        public void ContentOfItems_3()
        {
            StringDivider sut    = new StringDivider();
            var           result = sut.Divide("aab", 1);

            Assert.That(result[0], Is.EqualTo(new MaybeString("aa")));
            Assert.That(result[1], Is.EqualTo(new MaybeString("b")));
        }
コード例 #4
0
        public ExcelInternalAddress(string address)
        {
            Guard.ArgumentNotNullOrWhiteSpace(address, "address");

            StringDivider addressDivider = new StringDivider(address, divider: "!");

            this.SheetName = addressDivider.Left.TrimStartOnce("'").TrimEndOnce("'");
            this.Cell      = addressDivider.Right;
        }
コード例 #5
0
        public void Todo()
        {
            var    mWordFactory = new Mock <IWordFactory>();
            string inputWord    = "aab";

            mWordFactory.Setup(x => x.Create(inputWord))
            .Returns(new Word(new MaybeString(inputWord)));
            var sut    = new StringDivider(mWordFactory.Object, new WordSplitter());
            var result = sut.Divide(inputWord, 2);
        }
コード例 #6
0
        public void ContentOfItems_4()
        {
            var sut    = new StringDivider();
            var result = sut.Divide("aabbccdef", 2);

            Assert.That(result[0], Is.EqualTo(new MaybeString("aabb")));
            Assert.That(result[1], Is.EqualTo(new MaybeString("bbcc")));
            Assert.That(result[2], Is.EqualTo(new MaybeString("ccd")));
            Assert.That(result[3], Is.EqualTo(new MaybeString("de")));
            Assert.That(result[4], Is.EqualTo(new MaybeString("ef")));
        }
コード例 #7
0
 public void InitializeAncestor()
 {
     _ancestorDelimiter = "\u0001";
     _ancestorData      = Any.DelimitedString(_ancestorDelimiter);
     _ancestorDivider   = new RootStringDivider(_ancestorData, _ancestorDelimiter[0]);
 }
コード例 #8
0
        public void CountOfItems_Test12()
        {
            StringDivider sut = new StringDivider();

            Assert.That(sut.Divide("aabbccdef", 5).Count, Is.EqualTo(2));
        }
コード例 #9
0
        public void CountOfItems_Test9()
        {
            StringDivider sut = new StringDivider();

            Assert.That(sut.Divide("aabcdef", 2).Count, Is.EqualTo(5));
        }
コード例 #10
0
        public void CountOfItems_Test7()
        {
            StringDivider sut = new StringDivider();

            Assert.That(sut.Divide("abc", 3).Count, Is.EqualTo(1));
        }
コード例 #11
0
        public void CountOfItems_Test4()
        {
            StringDivider sut = new StringDivider();

            Assert.That(sut.Divide("ab", 1).Count, Is.EqualTo(2));
        }
コード例 #12
0
        public void ContentOfItems_2()
        {
            StringDivider sut = new StringDivider();

            Assert.That(sut.Divide("aa", 1)[0], Is.EqualTo(new MaybeString("aa")));
        }
コード例 #13
0
        public void CountOfItems_Test16()
        {
            StringDivider sut = new StringDivider();

            Assert.That(sut.Divide("aabbababaabbbab", 2).Count, Is.EqualTo(9));
        }
コード例 #14
0
        public void CountOfItems_Test14()
        {
            StringDivider sut = new StringDivider();

            Assert.That(sut.Divide("aabbaccd", 3).Count, Is.EqualTo(3));
        }