示例#1
0
 public void ConvertingWithWrongFormatShouldCauseException()
 {
     var converter = new DebugLevelConverter();
     var firstValue = DebugLevel.BoundingBoxes;
     var secondValue = DebugLevel.BoundingSpheres;
     var mergedValuesAsString = string.Format("{0}&{1}", firstValue, secondValue);
     converter.ConvertFrom(null, CultureInfo.InvariantCulture, mergedValuesAsString);
 }
示例#2
0
 public void ConvertingSingleValueShouldReturnOnlyThatValueSet()
 {
     var converter = new DebugLevelConverter();
     var expected = DebugLevel.BoundingBoxes;
     var valueAsString = expected.ToString();
     var converted = converter.ConvertFrom(null, CultureInfo.InvariantCulture, valueAsString);
     Assert.That(converted, Is.EqualTo(expected));
 }
示例#3
0
        public void ConvertingMultipleValuesShouldReturnAllValuesSet()
        {
            var converter = new DebugLevelConverter();
            var firstValue = DebugLevel.BoundingBoxes;
            var secondValue = DebugLevel.BoundingSpheres;
            var mergedValuesAsString = string.Format("{0}|{1}", firstValue, secondValue);
            var converted = (DebugLevel)converter.ConvertFrom(null, CultureInfo.InvariantCulture, mergedValuesAsString);

            Assert.That(converted & firstValue, Is.EqualTo(firstValue));
            Assert.That(converted & secondValue, Is.EqualTo(secondValue));
        }
示例#4
0
 public void ConvertingWithInvalidValuesShouldCauseException()
 {
     var converter = new DebugLevelConverter();
     var valuesAsString = "Something|SomethingElse";
     converter.ConvertFrom(null, CultureInfo.InvariantCulture, valuesAsString);
 }