summaryrefslogtreecommitdiffstats
path: root/IO/FileWriter.cs
blob: 846b7590ff7067b69f5a933c21426bb2d176dc10 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System.IO;
using Graph.Interfaces;

namespace Graph.IO
{
    // class for writing to file using IFileWriter (i.e. Dependancy injection for unit testing)
    public class FileWriter : IFileWriter
    {
        string FilePath { get; }

        public FileWriter(string filePath)
        {
            FilePath = filePath;
        }

        public void WriteAllLines(string[] lines)
        {
            File.WriteAllLines(FilePath, lines);
        }
    }
}