public void AdjustContainerTest()
        {
            //Arrange
            const string myContainer         = "myContainer";
            const string anotherContainer    = "anotherContainer";
            var          serviceConfigurator = new MetadataServiceConfigurator(myContainer, null, null, null, null);

            var metadata1 = new VideoMetadata()
            {
                Container = myContainer
            };
            var metadata2 = new VideoMetadata()
            {
                Container = anotherContainer
            };
            var metadataWithoutContainer = new VideoMetadata()
            {
                Container = null
            };

            var metadataService1 = new MetadataService(serviceConfigurator, metadata1);
            var metadataService2 = new MetadataService(serviceConfigurator, metadata2);
            var metadataService3 = new MetadataService(serviceConfigurator, metadataWithoutContainer);

            //Act
            var container1 = metadataService1.AdjustContainer();
            var container2 = metadataService2.AdjustContainer();

            //Act & Assert
            CustomAssert.IsThrown <MediaFormatException>(() => metadataService3.AdjustContainer());

            //Assert
            Assert.AreEqual(myContainer, container1);
            Assert.AreEqual(myContainer, container2);
        }
        public void CheckCorrectContainerTest()
        {
            //Arrange
            var serviceConfigurator = Factory.CreateMp4MetadataServiceConfigurator();

            var metadata = new VideoMetadata()
            {
                Container = serviceConfigurator.Container
            };

            var metadataService = new MetadataService(serviceConfigurator, metadata);

            //Act
            metadataService.AdjustContainer();

            //Assert
            Assert.IsTrue(metadataService.CorrectContainer);
        }
        public void AdjustVideoCodecTest()
        {
            //Arrange
            const string anotherCodecName = "anotherCodec";
            const string myCodecName      = "myCodec";
            var          myCodec          = new CodecData(myCodecName, null);

            var serviceConfigurator = new MetadataServiceConfigurator(null, null, myCodec, null, null);

            var metadata1 = new VideoMetadata()
            {
                VideoCodec = myCodecName
            };
            var metadata2 = new VideoMetadata()
            {
                VideoCodec = anotherCodecName
            };
            var metadataWithoutCodec = new VideoMetadata()
            {
                VideoCodec = null
            };

            var metadataService1 = new MetadataService(serviceConfigurator, metadata1);
            var metadataService2 = new MetadataService(serviceConfigurator, metadata2);
            var metadataService3 = new MetadataService(serviceConfigurator, metadataWithoutCodec);

            //Act
            var codec1 = metadataService1.AdjustVideoCodec();
            var codec2 = metadataService2.AdjustVideoCodec();

            //Act & Assert
            CustomAssert.IsThrown <MediaFormatException>(() => metadataService3.AdjustContainer());

            //Assert
            Assert.AreEqual(myCodecName, codec1);
            Assert.AreEqual(myCodecName, codec2);
        }
        public void CheckCorrectContainerTest()
        {
            //Arrange
            var serviceConfigurator = Factory.CreateMp4MetadataServiceConfigurator();

            var metadata = new VideoMetadata()
            {
                Container = serviceConfigurator.Container
            };

            var metadataService = new MetadataService(serviceConfigurator, metadata);

            //Act
            metadataService.AdjustContainer();

            //Assert
            Assert.IsTrue(metadataService.CorrectContainer);
        }
        public void AdjustVideoCodecTest()
        {
            //Arrange
            const string anotherCodecName = "anotherCodec";
            const string myCodecName = "myCodec";
            var myCodec = new CodecData(myCodecName, null);

            var serviceConfigurator = new MetadataServiceConfigurator(null, null, myCodec, null, null);

            var metadata1 = new VideoMetadata()
            {
                VideoCodec = myCodecName
            };
            var metadata2 = new VideoMetadata()
            {
                VideoCodec = anotherCodecName
            };
            var metadataWithoutCodec = new VideoMetadata()
            {
                VideoCodec = null
            };

            var metadataService1 = new MetadataService(serviceConfigurator, metadata1);
            var metadataService2 = new MetadataService(serviceConfigurator, metadata2);
            var metadataService3 = new MetadataService(serviceConfigurator, metadataWithoutCodec);

            //Act
            var codec1 = metadataService1.AdjustVideoCodec();
            var codec2 = metadataService2.AdjustVideoCodec();

            //Act & Assert
            CustomAssert.IsThrown<MediaFormatException>(() => metadataService3.AdjustContainer());

            //Assert
            Assert.AreEqual(myCodecName, codec1);
            Assert.AreEqual(myCodecName, codec2);
        }
        public void AdjustContainerTest()
        {
            //Arrange
            const string myContainer = "myContainer";
            const string anotherContainer = "anotherContainer";
            var serviceConfigurator = new MetadataServiceConfigurator(myContainer, null, null, null, null);

            var metadata1 = new VideoMetadata()
            {
                Container = myContainer
            };
            var metadata2 = new VideoMetadata()
            {
                Container = anotherContainer
            };
            var metadataWithoutContainer = new VideoMetadata()
            {
                Container = null
            };

            var metadataService1 = new MetadataService(serviceConfigurator, metadata1);
            var metadataService2 = new MetadataService(serviceConfigurator, metadata2);
            var metadataService3 = new MetadataService(serviceConfigurator, metadataWithoutContainer);

            //Act
            var container1 = metadataService1.AdjustContainer();
            var container2 = metadataService2.AdjustContainer();

            //Act & Assert
            CustomAssert.IsThrown<MediaFormatException>(() => metadataService3.AdjustContainer());

            //Assert
            Assert.AreEqual(myContainer, container1);
            Assert.AreEqual(myContainer, container2);
        }