public void Can_delete_mark()
        {
            #region Arrange

            JournalMarkModel markModel;
            using (var session = DataAccess.OpenSession())
            {
                markModel = new JournalMarkModel() {Name = "test", Value = "5.0"};
                session.SaveOrUpdate(markModel);
            }
            #endregion

            #region Act

            var ok = new JournalService().RemoveMark(markModel.ID);

            #endregion

            #region Assert
            Assert.IsTrue(ok);
            #endregion
        }
        public void SetUp()
        {
            //Initializaing Mappings
            DtoMappings.Initialize();

            //Initializing Data
            TestShoutBoxMessage = new ShoutBoxMessageModel{Author = "test",Message = "test",ShoutBoxId = 1,TimePosted = new DateTime(2010,10,10,10,10,10)};
            TestShoutBoxMessage1 = new ShoutBoxMessageModel { Author = "test", Message = "testLatest", ShoutBoxId = 1, TimePosted = new DateTime(2011, 10, 10, 10, 10, 10) };
            TestQuestionAnswer = new TestQuestionAnswer {Correct = true,NumberSelected = 0, Text = "test"};
            TestQuestion = new TestQuestionModel
                                { QuestionText = "test question",QuestionLabel ="test", Answers = new List<TestQuestionAnswer>
                                                                                { TestQuestionAnswer } };
            TestTestType = new TestTypeModel { TypeName = "test" };
            TestPofile = new ProfileModel { LoginName = "test", Email = "*****@*****.**", IsActive = true };
            TestTest = new TestModel
                            { Author = TestPofile, CreationDate = new DateTime(2010, 1, 1), Name = "test", TestType = TestTestType };
            LatestTest = new TestModel
                              { Author = TestPofile, CreationDate = new DateTime(2011, 1, 1), Name = "test", TestType = TestTestType };
            TestCourseType = new CourseTypeModel { TypeName = "Fizyka" };
            TestCourseType1 = new CourseTypeModel { TypeName = "Matematyka" };
            TestGroupType = new GroupTypeModel { TypeName = "test" };
            TestGroupType1 = new GroupTypeModel { TypeName = "test1" };
            TestGroup = new GroupModel { GroupType = TestGroupType, GroupName = "test" };
            TestForum = new ForumModel { Author = "test", Name = "test" };
            TestShoutBox = new ShoutboxModel();
            TestShoutBox.Messages.Add(TestShoutBoxMessage);
            TestShoutBox.Messages.Add(TestShoutBoxMessage1);
            TestSurvey = new SurveyModel
                              { SurveyText = "Smiga chodzi fruwa ?", DateCreated = new DateTime(2010, 1, 1) };
            TestLatestSurvey = new SurveyModel
                                    { SurveyText = "Smiga chodzi fruwa ?", DateCreated = new DateTime(2011, 1, 1) };

            TestCourse2 = new CourseModel
                               {
                CourseType = TestCourseType1,
                ShoutBox = TestShoutBox,
                Forum = TestForum,
                Group = TestGroup,
                CreationDate = DateTime.Now,
                Description = "test1",
                Logo = "/test1.jpg",
                Name = "test1",
                Password ="******"

            };

            TestCourse3 = new CourseModel
                               {
                CourseType = TestCourseType1,
                ShoutBox = TestShoutBox,
                Forum = TestForum,
                Group = TestGroup,
                CreationDate = DateTime.Now,
                Description = "test1",
                Logo = "/test1.jpg",
                Name = "test1",
                Password = null

            };
            TestContentType = new ContentTypeModel {TypeName = "test"};
            TestContent = new ContentModel
                               {
                                   ContentUrl = "test",
                                   CreationDate = DateTime.Now,
                                   DownloadNumber = 0,
                                   Name="test",
                                   Text = "test",
                                   Type = TestContentType
                               };
            TestJournalMark = new JournalMarkModel { Name = "Zaliczenie", Value = "5" };
            TestJournal = new JournalModel
                               { Course = TestCourse3,Marks = new List<JournalMarkModel>
                                                                                     { TestJournalMark }, Name = "test journal" };

            FileModel = new FileModel {FileName = "test", Address = "test"};
            SectionModel = new SectionModel {IconName = "test", Text = "test", Title = "tset"};

            LearningMaterialModel = new LearningMaterialModel
                                        {
                                            Level = 1,
                                            CreationDate = DateTime.Now,
                                            Description = "test",
                                            Goals = "test",
                                            Summary = "test",
                                            UpdateDate = DateTime.Now,
                                            VersionNumber = "111",
                                            Tests = new List<TestModel> {TestTest},
                                            Files = new List<FileModel> {FileModel},
                                            Sections = new List<SectionModel> {SectionModel}
                                        };
            TestCourse1 = new CourseModel
            {
                CourseType = TestCourseType,
                ShoutBox = TestShoutBox,
                Forum = TestForum,
                Group = TestGroup,
                CreationDate = DateTime.Now,
                Description = "test",
                Logo = "/test.jpg",
                Name = "test",
                Password = "******",
                LearningMaterials = new List<LearningMaterialModel> { LearningMaterialModel }
            };

            using (var session = DataAccess.OpenSession())
            {
                session.Save(TestPofile);
                session.Save(TestShoutBoxMessage);
                session.Save(TestShoutBoxMessage1);
                session.Save(TestCourseType);
                session.Save(TestGroupType);
                session.Save(TestGroupType1);
                session.Save(TestGroup);
                session.Save(TestForum);
                session.Save(TestShoutBox);
                session.Save(TestCourseType1);
                session.Save(TestSurvey);
                session.Save(TestLatestSurvey);
                session.Save(TestTestType);
                session.Save(TestTest);
                session.Save(LatestTest);
                session.Save(TestCourse1);
                session.Save(TestCourse2);
                session.Save(TestQuestionAnswer);
                session.Save(TestQuestion);
                session.Save(TestCourse3);
                session.Save(TestJournalMark);
                session.Save(TestJournal);
                session.Save(TestContentType);
                session.Save(TestContent);
                session.Save(FileModel);
                session.Save(SectionModel);
                session.Save(LearningMaterialModel);
                session.Flush();
            }
        }