Exemplo n.º 1
0
 private IReader GetStringBuildOutput()
 {
     string[] wordList = { "test,test1,test2", "0,0,0" };
     reader = new FileReader(new StringBuilder(), wordList, new PlainTextFileReader());
     reader.FormatFile();
     return(reader);
 }
Exemplo n.º 2
0
 public ActionResult <string> Get()
 {
     reader = new FileReader(new PlainTextFileReader());
     reader.ReadFile();
     reader.FormatFile();
     group = new Group(reader.MapToObject(), new EntityCounting());
     group.GroupByDepartment();
     group.DeleteNonValidElements();
     return(group.GetGroupedJson());
 }
Exemplo n.º 3
0
 public void FormatFile_Success()
 {
     reader = GetStringBuildOutput();
     Assert.IsTrue(reader.FormatFile().Length > 0);
 }
Exemplo n.º 4
0
 public void FormatFile_DataError_Error()
 {
     string[] wordList = { "test,,test1,test2", "0,0,0" };
     reader = new FileReader(wordList, new PlainTextFileReader());
     Assert.ThrowsException <ErrorParsingFileException>(() => reader.FormatFile());
 }
Exemplo n.º 5
0
 public void FormatFile_MissingData_Error()
 {
     string[] wordList = { "test,test1,test2" };
     reader = new FileReader(wordList, new PlainTextFileReader());
     Assert.ThrowsException <MissingHeaderOrDataException>(() => reader.FormatFile());
 }