public void VisOrdreDetaljer() { var SessionMock = new TestControllerBuilder(); var controller = new AdminController(new AdminBLL(new AdminRepositoryStub())); SessionMock.InitializeController(controller); controller.Session["AdminLoggetInn"] = true; var forventetResultat = new Bestilling() { BestillingsID = 100, KundeId = "sofia", BestillingsDato = new DateTime(2015, 11, 04, 08, 00, 00), Total = 0, }; // Act var actionResult = (ViewResult)controller.VisOrdreDetaljer(1); var resultat = (Bestilling)actionResult.Model; // Assert Assert.AreEqual(actionResult.ViewName, ""); Assert.AreEqual(forventetResultat.BestillingsID, resultat.BestillingsID); Assert.AreEqual(forventetResultat.KundeId, resultat.KundeId); Assert.AreEqual(forventetResultat.BestillingsDato, resultat.BestillingsDato); Assert.AreEqual(forventetResultat.Total, resultat.Total); }