public void Add_item_orders_to_project() { var sut = new ProjectRepository(REPO_PATH); var projectId = "123"; var prj = new Project { Id = projectId, Title = "T2", ProductOwnerEmail = "*****@*****.**", Items = new[] { "x", "y", "z" } }; sut.Create(prj); sut.Add_item_order_to_project(projectId, new ItemOrder { StakeholderEmail = "*****@*****.**", ItemIds = new[] { "0", "1", "2" } }); sut.Add_item_order_to_project(projectId, new ItemOrder { StakeholderEmail = "*****@*****.**", ItemIds = new[] { "2", "1", "0" } }); var loadedPrj = sut.Load(projectId); Assert.AreEqual(2, loadedPrj.ItemOrders.Length); Assert.AreEqual("*****@*****.**", loadedPrj.ItemOrders[0].StakeholderEmail); Assert.AreEqual(new[] { "0", "1", "2" }, loadedPrj.ItemOrders[0].ItemIds); Assert.AreEqual("*****@*****.**", loadedPrj.ItemOrders[1].StakeholderEmail); Assert.AreEqual(new[] { "2", "1", "0" }, loadedPrj.ItemOrders[1].ItemIds); }
public void Submit_ordered_items(string projectId, TotalOrderSubmissionDto req) { _repo.Add_item_order_to_project(projectId, new ItemOrder { StakeholderEmail = req.StakeholderEmail, ItemIds = req.ItemIds }); var prj = _repo.Load(projectId); Send_total_order_submission_notification(prj); }