Ejemplo n.º 1
0
        public void Path_ExistingFile_ReturnsFullPath()
        {
            const string fileName = "test.haml";
            var fileInfo = new FileInfo(fileName);
            string path = new FileViewSource(fileInfo).Path;

            Assert.That(path.Length, Is.GreaterThan(fileName.Length));
            Assert.That(path, Is.StringContaining(fileName));
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 3
0
 public void GetStreamReader_ExistingFile_ReturnsStream()
 {
     var fileInfo = new FileInfo("test.haml");
     var stream = new FileViewSource(fileInfo).GetStreamReader();
     Assert.That(stream.EndOfStream == false);
 }