コード例 #1
0
        Storage CreateStorage()
        {
            FileSystem filesystem = new WindowsFileSystem();
            var        serializer = new JsonSerializer(readableFormatting: true);
            var        path       = filesystem.CreatePath(filesystem.TempDirectory, @"MyTestFile.json");
            var        storage    = new TextFileStorage(filesystem, serializer, path);

            return(storage);
        }
コード例 #2
0
        public void Test_Sort_SortAscending()
        {
            var fileWorker = new TextFileStorage("myfile.log", false);
            var list       = new List <string>()
            {
                "c", "a", "b"
            };

            var result = fileWorker.Sort(list);

            Assert.AreEqual("a", result[0]);
            Assert.AreEqual("b", result[1]);
            Assert.AreEqual("c", result[2]);
        }
コード例 #3
0
 public ShowAppController(TvShowService showService, TextFileStorage fileStorage)
 {
     _showService = showService;
     _fileStorage = fileStorage;
 }