Пример #1
0
        public void TrainingVideoManagerEmptyDescription()
        {
            //Arrange
            TrainingVideo oldVideo = new TrainingVideo();

            oldVideo.TrainingVideoID = "B";
            oldVideo.RunTimeMinutes  = 1;
            oldVideo.RunTimeSeconds  = 1;
            oldVideo.Description     = "A";

            TrainingVideo newVideo = new TrainingVideo();

            newVideo.TrainingVideoID = "B";
            newVideo.RunTimeMinutes  = 1;
            newVideo.RunTimeSeconds  = 1;
            newVideo.Description     = "";

            bool test;
            ITrainingVideoManager trainingVideoManager = new TrainingVideoManager(_trainingVideoAccessor);

            //Act
            test = trainingVideoManager.EditTrainingVideo(oldVideo, newVideo);

            //Assert
            Assert.IsTrue(test);
        }
Пример #2
0
        public void TrainingVideoManagerUpdateVideoInvalidDetails()
        {
            //Arrange
            TrainingVideo oldVideo = new TrainingVideo();

            oldVideo.TrainingVideoID = "A";
            oldVideo.RunTimeMinutes  = 2;
            oldVideo.RunTimeSeconds  = 1;
            oldVideo.Description     = "A";

            TrainingVideo newVideo = new TrainingVideo();

            newVideo.TrainingVideoID = "B";
            newVideo.RunTimeMinutes  = 1;
            newVideo.RunTimeSeconds  = 1;
            newVideo.Description     = "A";

            bool test;
            ITrainingVideoManager trainingVideoManager = new TrainingVideoManager(_trainingVideoAccessor);

            //Act
            test = trainingVideoManager.EditTrainingVideo(oldVideo, newVideo);
        }
Пример #3
0
        public void TrainingVideoManagerUpdateVideoDescriptionTooLong()
        {
            //Arrange
            TrainingVideo oldVideo = new TrainingVideo();

            oldVideo.TrainingVideoID = "A";
            oldVideo.RunTimeMinutes  = 1;
            oldVideo.RunTimeSeconds  = 1;
            oldVideo.Description     = "A";

            TrainingVideo newVideo = new TrainingVideo();

            newVideo.TrainingVideoID = "A";
            newVideo.RunTimeMinutes  = 1;
            newVideo.RunTimeSeconds  = 1;
            newVideo.Description     =
                "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" +
                "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" +
                "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" +
                "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" +
                "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" +
                "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" +
                "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" +
                "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" +
                "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" +
                "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890" +
                "1";

            bool test;
            ITrainingVideoManager trainingVideoManager = new TrainingVideoManager(_trainingVideoAccessor);

            //Act
            test = trainingVideoManager.EditTrainingVideo(oldVideo, newVideo);

            //Assert
            Assert.IsTrue(test);
        }