예제 #1
0
        public virtual ActionResult Index()
        {
            var model = new ExpertiseEntity
            {
                Guid       = Guid.NewGuid(),
                DicStageId = GetStage()
            };

            return(PartialView("~/Views/DrugDeclaration/Index.cshtml", model));
        }
예제 #2
0
        public void ExpertiseRepository_Update_Works()
        {
            Guid guid   = Guid.NewGuid();
            var  entity = new ExpertiseEntity();
            var  mock   = new Mock <IExpertiseXMLService>();

            mock.Setup(T => T.Update(guid, entity));
            var repos = new ExpertiseRepository(mock.Object);

            repos.Update(guid, entity);

            Assert.IsTrue(true);
        }
        public void ExpertiseXMLService_Update_Works()
        {
            var id = xs.Insert(new ExpertiseEntity());

            var newOne = new ExpertiseEntity {
                Category = "cat", Expertise = "exp"
            };

            xs.Update(id, newOne);

            var reload = xs.Get(id);

            Assert.AreEqual("cat", reload.Category);
            Assert.AreEqual("exp", reload.Expertise);
        }
        public virtual ActionResult Index()
        {
            var dicStageId = GetStage();
            var repo       = new ExpertiseStageRepository();
            var userId     = UserHelper.GetCurrentEmployee().Id;
            var model      = new ExpertiseEntity
            {
                Guid            = Guid.NewGuid(),
                DicStageId      = GetStage(),
                NewInQueueCount = repo.GetCountByStage(true, dicStageId, EXP_DIC_StageStatus.New, userId),
                InWorkCount     = repo.GetCountByStage(false, dicStageId, EXP_DIC_StageStatus.InWork, userId),
                NewInWorkCount  = repo.GetCountByStage(true, dicStageId, EXP_DIC_StageStatus.InWork, userId)
            };

            return(PartialView("~/Views/DrugDeclaration/Index.cshtml", model));
        }
예제 #5
0
        public void ExpertiseRepository_Add_Works()
        {
            var exp = new ExpertiseEntity();

            exp.Category  = "testCat";
            exp.Expertise = "testExp";

            var mock = new Mock <IExpertiseXMLService>();

            mock.Setup(T => T.Insert(exp));
            var repos = new ExpertiseRepository(mock.Object);

            repos.Add(exp);

            Assert.IsTrue(true);
        }
예제 #6
0
        public void ExpertiseRepository_Get_Works()
        {
            Guid guid   = Guid.NewGuid();
            var  entity = new ExpertiseEntity();

            entity.Category  = "testCat";
            entity.Expertise = "testExp";

            var mock = new Mock <IExpertiseXMLService>();

            mock.Setup(T => T.Get(guid)).Returns(entity);

            var repos = new ExpertiseRepository(mock.Object);

            var returnedEntity = repos.Get(guid);

            Assert.IsNotNull(returnedEntity);
            Assert.AreEqual("testCat", returnedEntity.Category);
            Assert.AreEqual("testExp", returnedEntity.Expertise);
        }
예제 #7
0
        public void ExpertiseRepository_GetAll_Works()
        {
            var listCreated = new List <IExpertiseEntity>();

            for (int i = 0; i < 23; i++)
            {
                var ee = new ExpertiseEntity();
                ee.Category  = "testCat";
                ee.Expertise = "testExp";
                listCreated.Add(ee);
            }
            var mock = new Mock <IExpertiseXMLService>();

            mock.Setup(T => T.GetAll()).Returns(listCreated);
            var repos = new ExpertiseRepository(mock.Object);

            var list = repos.GetAll();

            Assert.IsNotNull(list);
            Assert.AreEqual(23, list.Count);
            Assert.IsTrue(list.All(T => T.Category == "testCat"));
            Assert.IsTrue(list.All(T => T.Expertise == "testExp"));
        }