Esempio n. 1
0
        public void FormatOutput_Verify()
        {
            var settingWrong1 = new FormatOutput(string.Empty);
            var settingWrong2 = new FormatOutput("  ");
            var setting = new FormatOutput("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 FormatOutput_Verify()
        {
            var settingWrong1 = new FormatOutput(string.Empty);
            var settingWrong2 = new FormatOutput("  ");
            var setting = new FormatOutput("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");
        }