Example #1
0
        public void If_the_filepath_ends_with_a_slash_the_filename_property_must_be_null()
        {
            var unixFilepath = new UnixFilepath("/etc/config/");

            Assert.AreEqual("/etc/config/", unixFilepath.Path, "Unexpected unix path.");
            Assert.IsNull(unixFilepath.Filename, "Unexpected unix filename.");
        }
Example #2
0
        public void Should_be_possible_to_create_a_structure_to_represent_unix_filepath()
        {
            var unixFilepath = new UnixFilepath("/etc/start.sh");

            Assert.AreEqual("/etc/", unixFilepath.Path, "Unexpected unix path.");
            Assert.AreEqual("start.sh", unixFilepath.Filename, "Unexpected unix filename.");
        }
Example #3
0
 public file_item CreateFileItem(string fullFilePath)
 {
     var unixFilepath = new UnixFilepath(fullFilePath);
     return new file_item()
     {
         filepath = OvalHelper.CreateItemEntityWithStringValue(fullFilePath),
         path = OvalHelper.CreateItemEntityWithStringValue(unixFilepath.Path),
         filename = unixFilepath.Filename == null ? null : OvalHelper.CreateItemEntityWithStringValue(unixFilepath.Filename)
     };
 }
Example #4
0
        public file_item CreateFileItem(string fullFilePath)
        {
            var unixFilepath = new UnixFilepath(fullFilePath);

            return(new file_item()
            {
                filepath = OvalHelper.CreateItemEntityWithStringValue(fullFilePath),
                path = OvalHelper.CreateItemEntityWithStringValue(unixFilepath.Path),
                filename = unixFilepath.Filename == null ? null : OvalHelper.CreateItemEntityWithStringValue(unixFilepath.Filename)
            });
        }