Esempio n. 1
0
        public void TestInitialize()
        {
            this.learnNowDbContext    = new Mock <LearnNowContext>();
            this.learningModuleMapper = new LearningModuleMapper(
                this.learnNowDbContext.Object);
            var moduleTagss = new List <LearningModuleTag>();
            var moduleTag   = new LearningModuleTag()
            {
                TagId            = Guid.NewGuid(),
                LearningModuleId = Guid.NewGuid(),
            };

            moduleTagss.Add(moduleTag);
            this.learningModule = new LearningModule
            {
                Id          = Guid.NewGuid(),
                Title       = "Test LM",
                Description = "Test LM",
                GradeId     = Guid.NewGuid(),
                SubjectId   = Guid.NewGuid(),
                Subject     = new Subject {
                    Id = Guid.NewGuid()
                },
                Grade = new Grade {
                    Id = Guid.NewGuid()
                },
                ImageUrl  = "https://img.com",
                CreatedBy = Guid.NewGuid(),
            };
            this.learningModuleViewModel = new LearningModuleViewModel
            {
                Id                = Guid.NewGuid(),
                Title             = "Test LM",
                Description       = "Test LM",
                GradeId           = Guid.NewGuid(),
                SubjectId         = Guid.NewGuid(),
                ImageUrl          = "https://img.com",
                LearningModuleTag = moduleTagss,
            };
            this.userDetail = new UserDetail
            {
                UserId      = Guid.NewGuid(),
                DisplayName = "User1",
            };
            this.userDetails = new List <UserDetail>
            {
                this.userDetail,
            };
        }
Esempio n. 2
0
        /// <summary>
        /// Make fake LearningModule data for different user.
        /// </summary>
        /// <returns>Tag collection</returns>
        public static LearningModule GetLearningModule()
        {
            var resourceTags = new List <LearningModuleTag>();
            var resourceTag  = new LearningModuleTag()
            {
                TagId            = Guid.Parse(Id),
                LearningModuleId = Guid.Parse(Id),
            };

            resourceTags.Add(resourceTag);
            var learningModule = new LearningModule()
            {
                Id                = Guid.Parse(Id),
                Title             = "test",
                CreatedBy         = Guid.NewGuid(),
                LearningModuleTag = resourceTags,
            };

            return(learningModule);
        }
        /// <summary>
        /// Make fake LearningModule data for different user.
        /// </summary>
        /// <returns>Tag collection</returns>
        public static LearningModuleViewModel GetPayLoadLearningModule()
        {
            var resourceTags = new List <LearningModuleTag>();
            var resourceTag  = new LearningModuleTag()
            {
                TagId            = Guid.Parse(Id),
                LearningModuleId = Guid.Parse(Id),
            };

            resourceTags.Add(resourceTag);
            var learningModule = new LearningModuleViewModel()
            {
                Id                = Guid.Parse(Id),
                Title             = "test",
                CreatedBy         = Guid.Parse(UserID),
                LearningModuleTag = resourceTags,
            };

            return(learningModule);
        }
Esempio n. 4
0
        /// <summary>
        /// Make fake LearningModule data for unit testing.
        /// </summary>
        /// <returns>Tag collection</returns>
        public static IEnumerable <LearningModule> GetLearningModules()
        {
            var resources     = new List <LearningModule>();
            var resourceTagss = new List <LearningModuleTag>();
            var resourceTag   = new LearningModuleTag()
            {
                TagId            = Guid.Parse(Id),
                LearningModuleId = Guid.Parse(Id),
            };

            resourceTagss.Add(resourceTag);
            var resource = new LearningModule()
            {
                Id                = Guid.Parse(Id),
                Title             = "test",
                CreatedBy         = Guid.Parse(UserID),
                LearningModuleTag = resourceTagss,
            };

            resources.Add(resource);

            return(resources);
        }