public void SeekTo_Verify() { var settingWrong1 = new SeekTo(0); var settingWrong2 = new SeekTo(-1); var setting = new SeekTo(120); Assert.Throws<InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); }); Assert.Throws<InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong2); }); Assert.DoesNotThrow(() => SettingSerializer.Serialize(setting)); Assert.Equal(SettingSerializer.Serialize(setting), "-ss 00:02:00.0"); }
public void SeekTo_Verify() { var settingWrong1 = new SeekTo(0); var settingWrong2 = new SeekTo(-1); var setting = new SeekTo(120); Assert.Throws<InvalidOperationException>(() => { var s = settingWrong1.GetAndValidateString(); }); Assert.Throws<InvalidOperationException>(() => { var s = settingWrong2.GetAndValidateString(); }); Assert.DoesNotThrow(() => { var s = setting.GetAndValidateString(); }); Assert.Equal(setting.GetAndValidateString(), "-ss 00:02:00.0"); }