using System; using System.Collections.Generic; using System.Linq; using System.Xml.Linq; using System.Text; using System.Diagnostics; using UnitTests.ViewModelsTests; using UnitTests.DataObjectsTests; using UnitTests.DataAccess; using UnitTests.DataObjectsTests.XmlSerializationTests; using UnitTests.UserActionsTests; namespace Test_Project { class Program { private const string Recipe = "Recipe"; private const string Description = "Description"; private const string Directions = "Directions"; private const string PrepTime = "PrepTime"; private const string CookTime = "CookTime"; private const string Ingredients = "Ingredients"; private const string Ingredient = "Ingredient"; private const string Name = "Name"; private const string Amount = "Amount"; private const string Units = "Units"; static void Main(string[] args) { var fixture = new RecipeViewModelFixture(); //var fixture = new CategoryViewModelFixture(); //var fixture = new ChefbookXmlRepositoryFixture(); //var fixture = new CategoryTreeViewModelFixture(); //var fixture = new MainFormViewModelFixture(); //var fixture = new RecipeListViewModelFixture(); //var fixture = new CategoryTreeViewModelFixture(); //var fixture = new XmlSerializerFixture(); //var fixture = new DeleteCategoryActionFixture(); fixture.Init(); fixture.RemoveCategoryFiresCollectionChangedTest(); } private static object ChefbookXmlRepositoryFixture() { throw new NotImplementedException(); } private static void CreationTesting() { Stopwatch creationtimer = new Stopwatch(); Stopwatch savetimer = new Stopwatch(); creationtimer.Start(); XElement root = new XElement("Root"); root.Add( new XElement(Recipe, new XAttribute(Name, "Chicken and \nShrimp Scampi"), new XElement(Description, new XText("A delicious combination \nof shrimp and chicken")), new XElement(Directions, new XText("Take some chicken, and \nshrimp and cut them up and cook")), new XElement(CookTime, new XText("30")), new XElement(PrepTime, new XText("45")), new XElement(Ingredients, new XElement(Ingredient, new XAttribute(Name, "Chicken \nbreasts, sliced"), new XAttribute(Amount, "1"), new XAttribute(Units, "Lbs")), new XElement(Ingredient, new XAttribute(Name, "Jumbo\n Shrimp"), new XAttribute(Amount, "10"), new XAttribute(Units, "")), new XElement(Ingredient, new XAttribute(Name, "Salted\n Butter"), new XAttribute(Amount, "3"), new XAttribute(Units, "tbsp"))))); XDocument xml = new XDocument( new XDeclaration("1.0", "utf-8", "yes")); xml.Add(root); creationtimer.Stop(); savetimer.Start(); xml.Save("Recipes.xml"); savetimer.Stop(); Console.WriteLine("Creation time: {0}", creationtimer.Elapsed); Console.WriteLine("Save time: {0}", savetimer.Elapsed); Console.ReadLine(); } } }