Пример #1
0
        public void Path_ExistingFile_ReturnsFullPath()
        {
            const string fileName = "test.haml";
            var fileInfo = new FileInfo(fileName);
            string path = new FileViewSource(fileInfo).FilePath;

            Assert.That(path.Length, Is.GreaterThan(fileName.Length));
            Assert.That(path, Is.StringContaining(fileName));
        }
Пример #2
0
        public void GetClassNameFromPathName_ValidPath_ReturnsValidClass()
        {
            // Arrange
            const string expectedClassName = "test_haml";

            const string fileName = "test.haml";
            var viewSource = new FileViewSource(new FileInfo(fileName));

            // Act
            string actual = viewSource.GetClassName();

            // Assert
            Assert.That(actual, Is.StringEnding(expectedClassName));
        }
Пример #3
0
 public void GetStreamReader_ExistingFile_ReturnsStream()
 {
     var fileInfo = new FileInfo("test.haml");
     var textReader = new FileViewSource(fileInfo).GetTextReader();
     Assert.That(textReader.Peek() != 0);
 }