public void TestAddInvoiceDetails()
        {
            InvoiceDB db = new InvoiceDB();
            Invoice i = db.Invoices.First();
            ((IObjectContextAdapter)db).ObjectContext.Detach(i); //http://stackoverflow.com/questions/4168073/entity-framework-code-first-no-detach-method-on-dbcontext
            Assert.NotNull(i);

            InvoiceDetailsController idc = new InvoiceDetailsController();
            idc.ControllerContext = new ControllerContext() { HttpContext=new MockHttpContext() };

            InvoiceDetails id = new InvoiceDetails();
            id.TimeStamp = DateTime.Now;
            id.Invoice = i;
            id.Qty = 1;
            id.Price = 100;
            id.VAT = 18;
            id.Article = "Invoice details test";

            //get
            System.Web.Mvc.ActionResult resultAddView = idc.Create(i.InvoiceID);
            Assert.IsInstanceOf(typeof(System.Web.Mvc.ViewResult), resultAddView);

            //post
            System.Web.Mvc.ActionResult resultAdd = idc.Create(id);
            Assert.IsInstanceOf(typeof(System.Web.Mvc.PartialViewResult), resultAdd);

            Assert.AreEqual(((System.Web.Mvc.PartialViewResult)resultAdd).ViewName, "Index");
        }