예제 #1
0
        public void Insert_DoesNotThrowsException_IfTwoFastStringBuildersContainsSameThing()
        {
            var a = new FastStringBuilder("test");
            var b = new FastStringBuilder("test");

            Assert.DoesNotThrow(() => a.Insert(0, b, 0, 1));
        }
예제 #2
0
        public void Insert_CanInsertPartOfAnotherFastStringBuilder(int position, int start, int length, string expected)
        {
            // Arrange
            var a = new FastStringBuilder("first");
            var b = new FastStringBuilder("second");

            // Act
            a.Insert(position, b, start, length);

            // Assert
            Assert.AreEqual(expected, a.ToString());
        }
예제 #3
0
        public void Insert_ThrowsException_IfYouPassSameFastStringBuilder()
        {
            var a = new FastStringBuilder("test");

            Assert.Throws <InvalidOperationException>(() => a.Insert(0, a, 0, 1));
        }