public void AddRoutes(List <Route> routes, String filePath) { List <string> data = new List <string>(); foreach (var route in routes) { data.Add($"{route.getFrom()},{route.getTo()},{route.getPrice()}"); } _fileManager.AddData(filePath, data, true); }
public void AddDataWithValidFileShouldSaveWithSuccess() { List <string> originalData = new List <string>(); originalData.Add("GRU,BRC,10"); originalData.Add("BRC,SCL,5"); originalData.Add("GRU,CDG,75"); originalData.Add("GRU,SCL,20"); originalData.Add("GRU,ORL,56"); originalData.Add("ORL,CDG,5"); originalData.Add("SCL,ORL,20"); _fileManager.AddData(VALID_FILE_PATH, originalData, false); _fileManager.GetFileData(VALID_FILE_PATH); var dataAfter = _fileManager.GetFileData(VALID_FILE_PATH); Assert.Equal(originalData.Count, dataAfter.Count); }