Example #1
0
        public void MovFlags_Verify()
        {
            var settingWrong1 = new MovFlags(string.Empty);
            var settingWrong2 = new MovFlags("  ");
            var setting       = new MovFlags(MovFlags.EnableFastStart);

            Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); });
            Assert.Throws <InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong2); });
            Assert.Equal("-movflags +faststart", SettingSerializer.Serialize(setting));
        }
Example #2
0
        public void MovFlags_Verify()
        {
            var settingWrong1 = new MovFlags(string.Empty);
            var settingWrong2 = new MovFlags("  ");
            var setting       = new MovFlags(MovFlags.EnableFastStart);

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