Skip to content

Commit

Permalink
WIP robot: export order
Browse files Browse the repository at this point in the history
  • Loading branch information
darakeon committed Aug 27, 2024
1 parent f5c77cf commit 40342ea
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion core/Tests/BusinessLogic/Steps/_D.RobotStep.cs
Original file line number Diff line number Diff line change
Expand Up @@ -562,9 +562,20 @@ public void ThenThereWillBeAnExportFileWithThisContent(Table table)
var expected = table.ToCsv()
.Select(r => r.ForScenario(scenarioCode));

var textToFindFile = "_";

if (orderInfo != null)
{
var user = repos.User.GetByEmail(userEmail);
var order = repos.Order.SingleOrDefault(o => o.User == user);

if (order != null)
textToFindFile = order.Guid + textToFindFile;
}

var file = Directory
.GetFiles(Cfg.S3.Directory, "*.csv")
.Where(f => f.Contains("_"))
.Where(f => f.Contains(textToFindFile))
.OrderByDescending(f => f.Split("_")[1])
.First();

Expand Down

0 comments on commit 40342ea

Please sign in to comment.