Esempio n. 1
0
        public void FormatInput_Verify()
        {
            var settingWrong1 = new FormatInput(string.Empty);
            var settingWrong2 = new FormatInput("  ");
            var setting = new FormatInput("mp4");

            Assert.Throws<InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); });
            Assert.Throws<InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong2); });
            Assert.DoesNotThrow(() => SettingSerializer.Serialize(setting));
            Assert.Equal(SettingSerializer.Serialize(setting), "-f mp4");
        }
Esempio n. 2
0
        public void FormatInput_Verify()
        {
            var settingWrong1 = new FormatInput(string.Empty);
            var settingWrong2 = new FormatInput("  ");
            var setting = new FormatInput("mp4");

            Assert.Throws<InvalidOperationException>(() => { var s = settingWrong1.GetAndValidateString(); });
            Assert.Throws<InvalidOperationException>(() => { var s = settingWrong2.GetAndValidateString(); });
            Assert.DoesNotThrow(() => { var s = setting.GetAndValidateString(); });
            Assert.Equal(setting.GetAndValidateString(), "-f mp4");
        }