public void CanOrderOrderedDocuments() { var path = Path.GetFullPath(@"data\ordered-documents\"); var command = new LoadDocumentsCommand(); command.Author = new Author(); command.DocumentsPath = path; command.OutputRootPath = Path.GetFullPath("output"); command.RenderedExtensions = new[] { "md" }; command.RootUrl = "http://www.example.com/"; command.ApplicationUrl = "/foo"; command.ExecuteAsync().Wait(); var order = new OrderCommand(); order.Documents = command.Documents; order.Execute(); Assert.Equal(1, order.Books.Count()); var doc = command.Documents.Skip(3).Take(1).Single(); var data = order.Books.First().GetAsDynamic(doc); }
private void Order(Site site) { using (var capture = Statistics.Current.Start(StatisticTiming.Ordering)) { var order = new OrderCommand(); order.Documents = site.Documents; order.Execute(); site.Books = order.Books; } }
public void TestTshirt() { // Given IProduct tshirt = new Tshirt(); PurchaseController controller = new PurchaseController(); ICommand order = new OrderCommand(tshirt); controller.InsertCommand(order); ICommand buy = new BuyCommand(tshirt); controller.InsertCommand(buy); // When var order_t = order.Execute(); var buy_t = buy.Execute(); // Then Assert.AreEqual("T-shirt", order_t); Assert.AreEqual("19.99", buy_t); }
public void TestShoes() { // Given IProduct shoes = new Shoes(); PurchaseController controller = new PurchaseController(); ICommand order = new OrderCommand(shoes); controller.InsertCommand(order); ICommand buy = new BuyCommand(shoes); controller.InsertCommand(buy); // When var order_t = order.Execute(); var buy_t = buy.Execute(); // Then Assert.AreEqual("Shoes", order_t); Assert.AreEqual("39.99", buy_t); }
public void CanOrderUnorderedDocuments() { var path = Path.GetFullPath(@"data\dated-documents\"); var command = new LoadDocumentsCommand(); command.Author = new Author(); command.DocumentsPath = path; command.OutputRootPath = Path.GetFullPath("output"); command.RenderedExtensions = new[] { "md" }; command.RootUrl = "http://www.example.com/"; command.ApplicationUrl = "/foo"; command.ExecuteAsync().Wait(); var order = new OrderCommand(); order.Documents = command.Documents; order.Execute(); Assert.Equal(0, order.Books.Count()); }
public void ExecuteCommand(OrderCommand command, MenuItem item) { command.Execute(this.currentItems, item); }