private FileModel CreateFileModel(string path, long size)
        {
            var model = new FileModel();

            model.Name = Path.GetFileName(path);
            model.Path = Path.GetFullPath(path);
            model.Hash = CryptographyProvider.Encode(File.ReadAllBytes(path));
            model.Size = SizeConverter.ConvertBytesToMegaBytes(size);

            return(model);
        }
Example #2
0
        public void ConvertBytesToMegaBytesCorrectResult()
        {
            var result = SizeConverter.ConvertBytesToMegaBytes(size);

            Assert.AreEqual(expectedOutput, result);
        }