Exemple #1
0
        public void UpdateAnnotationOnSubmissionForUser_InvalidArguments(string annotation, int submissionId, int userId)
        {
            // Arrange
            SOVAContext          databaseContext      = new SOVAContext(_connectionString);
            AnnotationRepository annotationRepository = new AnnotationRepository(databaseContext);

            // Act
            bool updated = annotationRepository.Update(annotation, submissionId, userId);

            // Assert
            Assert.False(updated);
        }
Exemple #2
0
        public void UpdateAnnotationOnSubmissionForUser_ValidArguments()
        {
            // Arrange
            SOVAContext          databaseContext      = new SOVAContext(_connectionString);
            AnnotationRepository annotationRepository = new AnnotationRepository(databaseContext);

            int    submissionId      = 19;
            string updatedAnnotation = "Test Test";

            User testUser = EnsureTestUserExistsThroughContext_ReturnsTestUser();

            EnsureTestAnnotationExistsThroughContext_ReturnsTestAnnotation(testUser.Id);

            // Act
            bool updated = annotationRepository.Update(updatedAnnotation, submissionId, testUser.Id);

            // Assert
            Assert.True(updated);
        }