Ejemplo n.º 1
0
        public void Level_Verify()
        {
            var settingWrong1 = new Level(-1);
            var setting = new Level(3.1);

            Assert.Throws<InvalidOperationException>(() => { SettingSerializer.Serialize(settingWrong1); });
            Assert.DoesNotThrow(() => SettingSerializer.Serialize(setting));
            Assert.Equal(SettingSerializer.Serialize(setting), "-level 3.1");
        }
Ejemplo n.º 2
0
        public void Level_Verify()
        {
            var settingWrong1 = new Level(-1);
            var setting = new Level(3.1);

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