public void Insert( )
        {
            muscle_log.framework.Models.MuscleLogContext ctx = new muscle_log.framework.Models.MuscleLogContext("metadata=res://*/Models.MuscleLogModel.csdl|res://*/Models.MuscleLogModel.ssdl|res://*/Models.MuscleLogModel.msl;provider=System.Data.SqlClient;provider connection string='data source=MAX-PC;Initial Catalog=muscle-log;User ID=Max-PC;integrated security=SSPI;multipleactiveresultsets=True;application name=EntityFramework'");
            var unitOfWork = new EFContextUnitOfWork(ctx);
            var repo = new Repository<ml_ForumThread>(unitOfWork);
            ForumThreadService service = new ForumThreadService(repo);
            int countBefore = service.ListThreads(muscle_log.framework.Util.Enum.Forums.Meta).Count();

            ForumThreadViewModel input = new ForumThreadViewModel( );
            input.ID = -1;
            input.UserID = 7;
            input.Title = "Testeintrag";
            input.Body = "Das ist ein Testeintrag. ~*</fsd !§$(%)=&??``´´'<<<><>>>@fsdf%%<%=fds";
            input.Forum = muscle_log.framework.Util.Enum.Forums.Meta;
            service.Save( input );

            int countAfter = service.ListThreads(muscle_log.framework.Util.Enum.Forums.Meta).Count();

            // there must be one more thread than  before
            Assert.AreEqual( countAfter, ( countBefore + 1 ) );

            // the id of the new thread must be bigger than 0
            Assert.Greater( input.ID, 0 );

            // the members of the input object and the output object must be equal
            var output = repo.Get(input.ID);
            Assert.AreNotEqual( input, output );
            Assert.AreEqual( input.Title, output.Title );
            Assert.AreEqual( input.Body, output.Body );
            Assert.AreEqual( input.Forum, output.Forum );
            Assert.AreEqual( input.UserID, output.UserID );

            unitOfWork.Dispose();
        }
        public void Update( )
        {
            muscle_log.framework.Models.MuscleLogContext ctx = new muscle_log.framework.Models.MuscleLogContext("metadata=res://*/Models.MuscleLogModel.csdl|res://*/Models.MuscleLogModel.ssdl|res://*/Models.MuscleLogModel.msl;provider=System.Data.SqlClient;provider connection string='data source=MAX-PC;Initial Catalog=muscle-log;User ID=Max-PC;integrated security=SSPI;multipleactiveresultsets=True;application name=EntityFramework'");
            var unitOfWork = new EFContextUnitOfWork(ctx);
            var repo = new Repository<ml_ForumThread>(unitOfWork);
            ForumThreadService service = new ForumThreadService(repo);

            ml_ForumThread model = service.GetThread(6);

            int beforeTraining = service.ListThreads(muscle_log.framework.Util.Enum.Forums.Training).Count();
            int beforeMeta = service.ListThreads(muscle_log.framework.Util.Enum.Forums.Meta).Count();
            model.Forum = muscle_log.framework.Util.Enum.Forums.Training.ToString();
            service.Save(model);

            ml_ForumThread modelAfterChange = repo.Get(model.ID);
            int afterTraining = service.ListThreads(muscle_log.framework.Util.Enum.Forums.Training).Count();
            int afterMeta = service.ListThreads(muscle_log.framework.Util.Enum.Forums.Meta).Count();

            Assert.AreNotEqual(afterTraining, beforeTraining);
            Assert.AreNotEqual(afterMeta, beforeMeta);
            Assert.AreNotEqual(model.LUDT, modelAfterChange.LUDT);

            unitOfWork.Dispose();
        }