Esempio n. 1
0
        public void AssociateUserTostudy_NonexistantRoleId_ThrowArgumentOutOfRangeException()
        {
            // Arrange
            var repo = new RepositoryFactoryMemory();
            var bll  = new UserBLL(repo);

            repo.GetUserRepo().Create(new UserEntity()
            {
                Id = 10
            });
            repo.GetStudyRepo().Create(new StudyEntity()
            {
                Id = 15
            });

            // Act
            bll.AssociateUserToStudy(10, 15, 5);
        }
Esempio n. 2
0
        public void AssociateUserToStudy_GoodInput_Success()
        {
            // Arrange
            var repo = new RepositoryFactoryMemory();
            var bll  = new UserBLL(repo);

            repo.GetUserRepo().Create(new UserEntity()
            {
            });

            // Act
            bll.AssociateUserToStudy(10, 15, 5);

            // Assert
            var storedDto = repo.GetUserStudyRelationRepo().Read(10, 15);

            Assert.AreEqual(storedDto.Id, 10);
            Assert.AreEqual(storedDto.Study_Id, 15);
            Assert.AreEqual(storedDto.StudyRole_Id, 5);
        }