コード例 #1
0
        public void ReadAllText()
        {
            // Arrange
            var expected = "This file contains simple text data.";

            // Act
            var actual = _service.ReadToEnd(@"EmbeddedResources.plaintext.txt");

            // Assert
            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void AnchorWithAccesskeyAttribute()
        {
            // Arrange
            var input = _textResource.ReadToEnd("Resources.TagAnchorAccesskey.html");

            var expected = new List <string>
            {
                "<a href=\"images/super-image.jpg\" accesskey=\"x\"> Look at my photo! </a>"
            };

            // Act
            var actual = input.ReplaceConsecutiveCharsWithSingle(' ')
                         .RemoveChars('\r', '\n', '\t')
                         .FindAnchorTags()
                         .ToList();

            // Assert
            CollectionAssert.AreEqual(expected, actual);
        }